# Integrate Mergin

Mergin is an open platform that aims to be developer friendly, and it has been designed to allow easy integration with other software.

# Python client

# Installation

The easiest way to use Mergin programmatically is to use the Python client module. It is available in the PyPI repository and so it can be installed with pip:

pip3 install mergin-client

# Python module

A quick code example to download a project:

from mergin import MerginClient

mc = MerginClient(login='john', password='pass')
mc.download_project('john/project1', '/home/john/mergin/project1')

You can of course also get project status, push/pull changes, create/delete projects and more.

The source code of the Python client is available on GitHub in lutraconsulting/mergin-py-client (opens new window) repository.

# Command line interface

For those who prefer using terminal, there is mergin command line tool shipped with the Python client. With several built-in commands, it is possible to download Mergin projects, push/pull changes, create or delete projects and more.

For example, to download a Mergin project to a local folder:

mergin download john/project1 ~/mergin/project1

Please see lutraconsulting/mergin-py-client (opens new window) repository for more information on the usage.

# C++ standalone client

C++ Client has advantage over Python that is is completely without any dependencies.

# Installation

Just download (opens new window) binary for your platform and use it from command line.

# Usage

$ mergin --help
Usage: mergin [OPTIONS] COMMAND [ARGS]...

  --help      Show this message and exit.
  --version   Show the version information.
  --username  Mergin username (or MERGIN_USERNAME env. variable)
  --password  Mergin password (or MERGIN_PASSWORD env. variable)
  --url       Mergin url      (defaults to app.merginmaps.com)

  create         Create a new project on Mergin server
  download       Download last version of mergin project
  sync           Pull&Push the changes
  remove         Remove project from server.

Please see lutraconsulting/mergin-cpp-client (opens new window) repository for more information on the usage.

# C++ Mergin API core library

Client is based on the Qt-based mergin api core library (opens new window) used by the Mergin Maps Input to sync the projects in the mobile application.