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.

pip install pre-commit
# if you want to have git commits trigger pre-commit, install pre-commit hook:
pre-commit install
# else run manually before (re)staging your files:
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
python3 -m pip install pipenv
pre-commit install
# install package in a virtual environment
pipenv install -r requirements.txt

To run CLI interface for development purposes execute:

pipenv shell # if your pipenv virtual environment is not active yet
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
pipenv run qfieldcloud-cli

Building the package

# make sure your shell is sourced to no virtual environment
deactivate
# build
python3 -m build
# now either activate your shell with
pipenv shell
# and install with
python -m pip install . --force-reinstall
# or manually ensure it's pipenv and not your global pip doing the installation
pipenv run pip install . --force-reinstall

Voilà!

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.13.0.tar.gz (31.4 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.13.0-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for qfieldcloud_sdk-0.13.0.tar.gz
Algorithm Hash digest
SHA256 09e4db198b9fa56d6eb1379d1f2849ddbde1f2e18e26fec60d7211340298f75a
MD5 db59f5109041410c6a255f2985683c7f
BLAKE2b-256 69daace06ab865e26d7887652021bc36b39ddfbd0b4bbbf34d41f6324c8caa78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qfieldcloud_sdk-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93f5f077503df93288ae95be398947725f80a37194592ad31a7830e3497a58e3
MD5 514267c27db601019870fe1658d2b914
BLAKE2b-256 eb2fa43c7569ab690207a32ba7f252a0284ae0c940720a4f632a8aad08d4e326

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