Skip to main content

The official QFieldCloud SDK and CLI.

Project description

The official QFieldCloud SDK and CLI

qfieldcloud-sdk is the official client to connect to QFieldCloud API either as a Python module, or directly from the command line interface (CLI).

Contents

Documentation

QFieldCloud SDK Documentation

Installation

Linux/macOS

pip3 install qfieldcloud-sdk

Windows

Install Python with your favorite package manager. Then:

python -m pip install qfieldcloud-sdk

CLI usage

The package provides the official QFieldCloud CLI tool.

Usage

qfieldcloud-cli [OPTIONS] COMMAND [ARGS]...

Examples

# logs in user "user" with password "pass"
qfieldcloud-cli login user pass

# gets the projects of user "user" with password "pass" at "https://localhost/api/v1/"
qfieldcloud-cli -u user -p pass -U https://localhost/api/v1/ list-projects

# gets the projects of user authenticated with token `QFIELDCLOUD_TOKEN` at "https://localhost/api/v1/" as JSON
export QFIELDCLOUD_URL=https://localhost/api/v1/
export QFIELDCLOUD_TOKEN=017478ee2464440cb8d3e98080df5e5a
qfieldcloud-cli --json list-projects

Check the examples page in the documentation for more examples.

Module usage

from qfieldcloud_sdk import sdk

client = sdk.Client(url="https://app.qfield.cloud/api/v1/")
client.login(
    username="user1",
    password="pass1",
)

projects = client.list_projects()
> projects
Projects:
0       myusername/myproject1
1       myusername/myproject2
...

Development

Contributions are more than welcome!

Code style

Code style done with precommit.

uv sync --group dev
# if you want to have git commits trigger pre-commit, install pre-commit hook:
uv run pre-commit install
# else run manually before (re)staging your files:
uv run pre-commit run --all-files

Cloning the project

One time action to clone and setup:

git clone https://github.com/opengisch/qfieldcloud-sdk-python
cd qfieldcloud-sdk-python
# install dev dependencies (+ standard dependencies)
uv sync --group dev
uv run pre-commit install

To run CLI interface for development purposes execute:

uv run python -m qfieldcloud_sdk

To ease development, you can set a .env file. Therefore you can use directly the qfieldcloud-cli executable:

cp .env.example .env
uv run qfieldcloud-cli

Building the package

# make sure your shell is sourced to no virtual environment
deactivate
# build
uv run python -m build
# and install with
uv run python -m pip install . --force-reinstall

Voilà!

Running the tests

uv sync --group dev
ENVIRONMENT=test uv run python -m unittest discover -s tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qfieldcloud_sdk-0.16.0.tar.gz (103.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qfieldcloud_sdk-0.16.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file qfieldcloud_sdk-0.16.0.tar.gz.

File metadata

  • Download URL: qfieldcloud_sdk-0.16.0.tar.gz
  • Upload date:
  • Size: 103.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qfieldcloud_sdk-0.16.0.tar.gz
Algorithm Hash digest
SHA256 f0f7759e38ac9e030af402adfe25a0aab5e230622d076357288836600a5fc353
MD5 9d81afd15027b48ef8f446b153c910b1
BLAKE2b-256 3542caaafd1d4cef9541946c2033b200e0fb164a44e025fcaf101575861c89f2

See more details on using hashes here.

File details

Details for the file qfieldcloud_sdk-0.16.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qfieldcloud_sdk-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13716c00d09490b01de19ba38b299bda9bad0ab740c263cc5e227923344b4008
MD5 012c7f5b18f8a2922c48136011be171d
BLAKE2b-256 65231ccca8a2321701b26d013077b24bc3d2e32c4d7fc6d6d6bb79c330f14888

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page