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.15.0.tar.gz (103.0 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.15.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qfieldcloud_sdk-0.15.0.tar.gz
  • Upload date:
  • Size: 103.0 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.15.0.tar.gz
Algorithm Hash digest
SHA256 63738ce26c362fecab6fa0fad3c39658d32dfabfe602fde9192c07ee4de7de4a
MD5 64172d649a057a1e32c4f4388ba6813e
BLAKE2b-256 bf4ae1d3321cc71a9e21038319bf242a00bcf0016d2f9f6d2578aa577993940c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qfieldcloud_sdk-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f9e225bade76893374b4fef563f2fe289b1aa55b5ef0a2fa5e0367405562165
MD5 e9c03e7b961533f3c3c2129e1b5a9847
BLAKE2b-256 ad2398d0c73ddda2031722c27de5a8209f818b2c26bab911831314d8f35e79ea

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