qfieldcloud-sdk


Nameqfieldcloud-sdk JSON
Version 0.8.2 PyPI version JSON
download
home_page
SummaryThe official QFieldCloud SDK and CLI.
upload_time2023-10-25 02:01:53
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords qfieldcloud qfield qgis ci sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

## Contents

- [Installation](#install)
- [CLI usage](#cli-usage)
- [Module usage](#module-usage)

## Install

### 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 also ships with the official QFieldCloud CLI tool.

### Usage

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

### Examples

```shell
# 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
```

More detailed documentation can be found [here](https://docs.qfield.org/reference/qfieldcloud/sdk/)

## Module usage

```python
from  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](https://pre-commit.com/).

```
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:

```shell
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:

```shell
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

```shell
# 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Ă !

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "qfieldcloud-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "QFieldCloud,QField,QGIS,CI,SDK",
    "author": "",
    "author_email": "Ivan Ivanov <ivan@opengis.ch>",
    "download_url": "https://files.pythonhosted.org/packages/b2/60/695c96259b198c161d8c661f99cc8b975cfb16b1ea3bced8f87abb1e22b8/qfieldcloud-sdk-0.8.2.tar.gz",
    "platform": null,
    "description": "# The official QFieldCloud SDK and CLI\n\n`qfieldcloud-sdk` is the official client to connect to QFieldCloud API either as a python module, or directly from the command line.\n\n## Contents\n\n- [Installation](#install)\n- [CLI usage](#cli-usage)\n- [Module usage](#module-usage)\n\n## Install\n\n### Linux/macOS\n\n    pip3 install qfieldcloud-sdk\n\n### Windows\n\nInstall Python with your favorite package manager. Then:\n\n    python -m pip install qfieldcloud-sdk\n\n## CLI usage\n\nThe package also ships with the official QFieldCloud CLI tool.\n\n### Usage\n\n```\nqfieldcloud-cli [OPTIONS] COMMAND [ARGS]...\n```\n\n### Examples\n\n```shell\n# logs in user \"user\" with password \"pass\"\nqfieldcloud-cli login user pass\n\n# gets the projects of user \"user\" with password \"pass\" at \"https://localhost/api/v1/\"\nqfieldcloud-cli -u user -p pass -U https://localhost/api/v1/ list-projects\n\n# gets the projects of user authenticated with token `QFIELDCLOUD_TOKEN` at \"https://localhost/api/v1/\" as JSON\nexport QFIELDCLOUD_URL=https://localhost/api/v1/\nexport QFIELDCLOUD_TOKEN=017478ee2464440cb8d3e98080df5e5a\nqfieldcloud-cli --json list-projects\n```\n\nMore detailed documentation can be found [here](https://docs.qfield.org/reference/qfieldcloud/sdk/)\n\n## Module usage\n\n```python\nfrom  import sdk\n\nclient = sdk.Client(url=\"https://app.qfield.cloud/api/v1/\")\nclient.login(\n    username=\"user1\",\n    password=\"pass1\",\n)\n\nprojects = client.list_projects()\n> projects\nProjects:\n0       myusername/myproject1\n1       myusername/myproject2\n...\n```\n\n## Development\n\nContributions are more than welcome!\n\n### Code style\n\nCode style done with [precommit](https://pre-commit.com/).\n\n```\npip install pre-commit\n# if you want to have git commits trigger pre-commit, install pre-commit hook:\npre-commit install\n# else run manually before (re)staging your files:\npre-commit run --all-files\n```\n\n### Cloning the project\n\nOne time action to clone and setup:\n\n```shell\ngit clone https://github.com/opengisch/qfieldcloud-sdk-python\ncd qfieldcloud-sdk-python\n# install dev dependencies\npython3 -m pip install pipenv\npre-commit install\n# install package in a virtual environment\npipenv install -r requirements.txt\n```\nTo run CLI interface for development purposes execute:\n\n```shell\npipenv shell # if your pipenv virtual environment is not active yet\npython -m qfieldcloud_sdk\n```\nTo ease development, you can set a `.env` file. Therefore you can use directly the `qfieldcloud-cli` executable:\n```\ncp .env.example .env\npipenv run qfieldcloud-cli\n```\n\n### Building the package\n\n```shell\n# make sure your shell is sourced to no virtual environment\ndeactivate\n# build\npython3 -m build\n# now either activate your shell with\npipenv shell\n# and install with\npython -m pip install . --force-reinstall\n# or manually ensure it's pipenv and not your global pip doing the installation\npipenv run pip install . --force-reinstall\n```\nVoil\u00e0!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "The official QFieldCloud SDK and CLI.",
    "version": "0.8.2",
    "project_urls": {
        "documentation": "https://github.com/opengisch/qfieldcloud-sdk-python",
        "homepage": "https://github.com/opengisch/qfieldcloud-sdk-python",
        "repository": "https://github.com/opengisch/qfieldcloud-sdk-python",
        "tracker": "https://github.com/opengisch/qfieldcloud-sdk-python/issues"
    },
    "split_keywords": [
        "qfieldcloud",
        "qfield",
        "qgis",
        "ci",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa28c849390ecf54f7e254923029930fc27ef614e49cb5e93e3dfb887579ae89",
                "md5": "d09a3569331f33a02571617fc28981c7",
                "sha256": "a389ae766520181aa7eba68cc7d65f5dda20163ebb3671e4116c281a52821a4e"
            },
            "downloads": -1,
            "filename": "qfieldcloud_sdk-0.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d09a3569331f33a02571617fc28981c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15365,
            "upload_time": "2023-10-25T02:01:52",
            "upload_time_iso_8601": "2023-10-25T02:01:52.212084Z",
            "url": "https://files.pythonhosted.org/packages/fa/28/c849390ecf54f7e254923029930fc27ef614e49cb5e93e3dfb887579ae89/qfieldcloud_sdk-0.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b260695c96259b198c161d8c661f99cc8b975cfb16b1ea3bced8f87abb1e22b8",
                "md5": "89cd19f1260b624bf9c16182929ea494",
                "sha256": "2c2002ed3c5d906ebb5d52c7cebfc12145733204485526e9d81d5b74ca5bbcdf"
            },
            "downloads": -1,
            "filename": "qfieldcloud-sdk-0.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "89cd19f1260b624bf9c16182929ea494",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17338,
            "upload_time": "2023-10-25T02:01:53",
            "upload_time_iso_8601": "2023-10-25T02:01:53.685858Z",
            "url": "https://files.pythonhosted.org/packages/b2/60/695c96259b198c161d8c661f99cc8b975cfb16b1ea3bced8f87abb1e22b8/qfieldcloud-sdk-0.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-25 02:01:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "opengisch",
    "github_project": "qfieldcloud-sdk-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "qfieldcloud-sdk"
}
        
Elapsed time: 0.17469s