# Iotics gRPC Python Client
A Python library for interacting with Iotics API.
## Usage and Version Compatibility with Iotics host:
| iotics-grpc-client-py | iotics-host |
|----------------------| ----------- |
| `pip install iotics-grpc-client~=5.0` | `>= 6` |
| `pip install iotics-grpc-client~=4.0` | `>= 6` |
| `pip install iotics-grpc-client~=3.0` | `>= 6` |
| `pip install iotics-grpc-client~=2.0` | `>= 5` |
| `pip install iotics-grpc-client~=0.10.0` | `>= 4` |
# Examples
## Configuring identity
To run examples, either set up required environment variables or create an `.env` file with the following values. For
more information on the meaning of these values and how to create them, consult https://docs.iotics.com/docs/identity-api-and-credentials
* __Required__:
* `SPACE` - Domain name of the IOTICSpace with which to communicate. The scheme can be omitted, eg. examplecorp.
iotics.space
* `USER_DID` - Identity of the user
* `AGENT_DID` - Identity of the agent authorised to operate on the user's behalf
* `AGENT_KEY_NAME` - __secret__ value used to (re)create multiple key pairs
* `AGENT_NAME` - registered identity name that can be used to e.g. identify public keys
* `AGENT_SECRET` - __secret__ value, the agent's private key
* __Optional__:
* `DID_RESOLVER_URL` - Where the database of identity documents is accessible, defaults to the one used by the given
space.
* `TOKEN_TTL` - How long in seconds auth tokens will last if not specified in the method call, defaults to 30
## Running example scripts
Next, create and activate your virtual environment and run any of the scripts in the [examples](https://github.com/Iotic-Labs/iotics-grpc-client-py/tree/main/examples) directory,
e.g.:
```bash
make deps-py
. env/bin/activate
python examples/search_twin_models.py
```
# FAQs
## Installing on Raspberry PI get: Import error GLIBC_2.33 not found
If you see this error running the exmaples on a Rapberry PI, the current workaround is to install Ubuntu for RPi which has a later version of glibc.
```bash
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version 'GLIBC_2.33' not found (required by /home/pi/work/starting/iotics-grpc-client-py/env/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so)
```
# Contributing
## Installing dependencies and generating gRPC client
* To satisfy all dependencies, lint proto files and regenerate client files (inside a Docker container):
```shell
make build
```
* To generate gRPC Python files outside a Docker container the following command can be used: `make generate`.
Currently, there is no official binary for Python gRPC plugin, but there is one built from the official repository
inside the docker (the following will work on Linux machines):
```bash
docker run --rm -dit --name iotics-grpc-client-py-builder iotics-grpc-client-py-builder /bin/bash
docker cp iotics-grpc-client-py-builder:/bin/protoc-gen-python_grpc env/bin/protoc-gen-python_grpc
docker stop iotics-grpc-client-py-builder
make generate
```
* To update the Iotics API version and regenerate client
(proto files are submoduled in [./iotics-api.git/](./iotics-api.git)
from [Iotics API](https://github.com/Iotic-Labs/api) repo):
```bash
_ver=vX.X.X
make GIT_TAG=$_ver deps-proto-update build
# Address usages of the new client in `src`, update "Unreleased" section in CHANGELOG.md, then:
git add CHANGELOG.md iotics-api.git src
git commit -m "Update Iotics API to $_ver"
# Push your branch and create a PR
```
* Other `make` commands:
* `clean` - remove artifacts created inside the project.
* `deps-*` - install specific requirements if missing.
* `deps-*-update` - update specific requirements when applicable.
## PRs
Should contain a summary of the changes in [CHANGELOG.md](https://github.com/Iotic-Labs/iotics-grpc-client-py/blob/main/CHANGELOG.md) under the "Unreleased" section.
## Versioning
This package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
## Releasing
* Update package version in [setup.cfg](./setup.cfg) for the release:
* Update [CHANGELOG.md](./CHANGELOG.md) (move notes from unreleased section, ensure right tags are used, etc.)
and any other files as needed.
* Commit changes and create a [PR](https://github.com/Iotic-Labs/iotics-grpc-client-py/compare).
* Once PR is merged manually run the [Create Draft Release GitHub Action](https://github.com/Iotic-Labs/iotics-grpc-client-py/actions/workflows/draft_release.yml), this will create a tag with the version in setup.py and create a draft release in [releases](https://github.com/Iotic-Labs/iotics-grpc-client-py/releases).
* Update the release's information and press the publish button on the release to publish it.
* The [Publish GitHub Action](https://github.com/Iotic-Labs/iotics-grpc-client-ts/actions/workflows/publish.yml)
will create a package and will publish it to [PyPI](https://pypi.org/project/iotics-grpc-client).
# License
Copyright © 2022 IOTIC LABS LTD. info@iotics.com. All rights reserved. Licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/Iotic-Labs/iotics-grpc-client-py/tree/main/LICENSE) in the project root for license information.
Raw data
{
"_id": null,
"home_page": "https://github.com/Iotic-Labs/iotics-grpc-client-py",
"name": "iotics-grpc-client",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "iotics,grpc,digital twin",
"author": "Iotics",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/cb/88/5b3831f8411d53ae689759f73a813f1008778d3fb8a8da30f2f381bdf692/iotics-grpc-client-5.0.0.tar.gz",
"platform": "any",
"description": "# Iotics gRPC Python Client\nA Python library for interacting with Iotics API.\n\n\n## Usage and Version Compatibility with Iotics host:\n\n| iotics-grpc-client-py | iotics-host |\n|----------------------| ----------- |\n| `pip install iotics-grpc-client~=5.0` | `>= 6` |\n| `pip install iotics-grpc-client~=4.0` | `>= 6` |\n| `pip install iotics-grpc-client~=3.0` | `>= 6` |\n| `pip install iotics-grpc-client~=2.0` | `>= 5` |\n| `pip install iotics-grpc-client~=0.10.0` | `>= 4` |\n\n\n\n# Examples\n## Configuring identity\nTo run examples, either set up required environment variables or create an `.env` file with the following values. For\nmore information on the meaning of these values and how to create them, consult https://docs.iotics.com/docs/identity-api-and-credentials\n* __Required__:\n * `SPACE` - Domain name of the IOTICSpace with which to communicate. The scheme can be omitted, eg. examplecorp.\n iotics.space\n * `USER_DID` - Identity of the user\n * `AGENT_DID` - Identity of the agent authorised to operate on the user's behalf\n * `AGENT_KEY_NAME` - __secret__ value used to (re)create multiple key pairs\n * `AGENT_NAME` - registered identity name that can be used to e.g. identify public keys\n * `AGENT_SECRET` - __secret__ value, the agent's private key\n\n* __Optional__:\n * `DID_RESOLVER_URL` - Where the database of identity documents is accessible, defaults to the one used by the given \n space.\n * `TOKEN_TTL` - How long in seconds auth tokens will last if not specified in the method call, defaults to 30\n## Running example scripts\nNext, create and activate your virtual environment and run any of the scripts in the [examples](https://github.com/Iotic-Labs/iotics-grpc-client-py/tree/main/examples) directory, \ne.g.:\n```bash\nmake deps-py\n. env/bin/activate\npython examples/search_twin_models.py\n```\n\n\n# FAQs\n\n## Installing on Raspberry PI get: Import error GLIBC_2.33 not found\n\nIf you see this error running the exmaples on a Rapberry PI, the current workaround is to install Ubuntu for RPi which has a later version of glibc.\n\n```bash\nImportError: /lib/arm-linux-gnueabihf/libc.so.6: version 'GLIBC_2.33' not found (required by /home/pi/work/starting/iotics-grpc-client-py/env/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so)\n```\n\n\n\n# Contributing\n\n\n## Installing dependencies and generating gRPC client\n* To satisfy all dependencies, lint proto files and regenerate client files (inside a Docker container):\n ```shell\n make build\n ```\n * To generate gRPC Python files outside a Docker container the following command can be used: `make generate`.\n Currently, there is no official binary for Python gRPC plugin, but there is one built from the official repository\n inside the docker (the following will work on Linux machines):\n ```bash\n docker run --rm -dit --name iotics-grpc-client-py-builder iotics-grpc-client-py-builder /bin/bash\n docker cp iotics-grpc-client-py-builder:/bin/protoc-gen-python_grpc env/bin/protoc-gen-python_grpc\n docker stop iotics-grpc-client-py-builder\n make generate\n ```\n* To update the Iotics API version and regenerate client \n (proto files are submoduled in [./iotics-api.git/](./iotics-api.git)\n from [Iotics API](https://github.com/Iotic-Labs/api) repo):\n ```bash\n _ver=vX.X.X\n make GIT_TAG=$_ver deps-proto-update build\n # Address usages of the new client in `src`, update \"Unreleased\" section in CHANGELOG.md, then:\n git add CHANGELOG.md iotics-api.git src\n git commit -m \"Update Iotics API to $_ver\"\n # Push your branch and create a PR\n ```\n* Other `make` commands:\n * `clean` - remove artifacts created inside the project.\n * `deps-*` - install specific requirements if missing.\n * `deps-*-update` - update specific requirements when applicable.\n\n\n## PRs\nShould contain a summary of the changes in [CHANGELOG.md](https://github.com/Iotic-Labs/iotics-grpc-client-py/blob/main/CHANGELOG.md) under the \"Unreleased\" section.\n\n\n## Versioning\n\nThis package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)\n\n\n## Releasing\n* Update package version in [setup.cfg](./setup.cfg) for the release:\n* Update [CHANGELOG.md](./CHANGELOG.md) (move notes from unreleased section, ensure right tags are used, etc.)\n and any other files as needed.\n* Commit changes and create a [PR](https://github.com/Iotic-Labs/iotics-grpc-client-py/compare).\n* Once PR is merged manually run the [Create Draft Release GitHub Action](https://github.com/Iotic-Labs/iotics-grpc-client-py/actions/workflows/draft_release.yml), this will create a tag with the version in setup.py and create a draft release in [releases](https://github.com/Iotic-Labs/iotics-grpc-client-py/releases).\n* Update the release's information and press the publish button on the release to publish it.\n* The [Publish GitHub Action](https://github.com/Iotic-Labs/iotics-grpc-client-ts/actions/workflows/publish.yml)\n will create a package and will publish it to [PyPI](https://pypi.org/project/iotics-grpc-client).\n\n\n# License\n\nCopyright \u00a9 2022 IOTIC LABS LTD. info@iotics.com. All rights reserved. Licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/Iotic-Labs/iotics-grpc-client-py/tree/main/LICENSE) in the project root for license information.\n\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Iotics gRPC client library",
"version": "5.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/Iotic-Labs/iotics-grpc-client-py/issues",
"Changelog": "https://github.com/Iotic-Labs/iotics-grpc-client-py/releases",
"Homepage": "https://github.com/Iotic-Labs/iotics-grpc-client-py"
},
"split_keywords": [
"iotics",
"grpc",
"digital twin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7e5dab7ec7aff7a18f364d45837b4062515d6e2cb935274c9685b715ba472b1c",
"md5": "25a412a65df808fd3814ff04f028f064",
"sha256": "e70608a0bd8e7f240c1936b9a52af04cee1b76832d3234dc15d15fd00c667140"
},
"downloads": -1,
"filename": "iotics_grpc_client-5.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "25a412a65df808fd3814ff04f028f064",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 53677,
"upload_time": "2024-01-26T11:58:14",
"upload_time_iso_8601": "2024-01-26T11:58:14.285398Z",
"url": "https://files.pythonhosted.org/packages/7e/5d/ab7ec7aff7a18f364d45837b4062515d6e2cb935274c9685b715ba472b1c/iotics_grpc_client-5.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cb885b3831f8411d53ae689759f73a813f1008778d3fb8a8da30f2f381bdf692",
"md5": "ace21df573b4ad835f8c237186c6a7bc",
"sha256": "45a195b6eed25264fc37303b4b3d4d2e1bc68ac68bb3262ada09e5f13204e94f"
},
"downloads": -1,
"filename": "iotics-grpc-client-5.0.0.tar.gz",
"has_sig": false,
"md5_digest": "ace21df573b4ad835f8c237186c6a7bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 34799,
"upload_time": "2024-01-26T11:58:16",
"upload_time_iso_8601": "2024-01-26T11:58:16.167999Z",
"url": "https://files.pythonhosted.org/packages/cb/88/5b3831f8411d53ae689759f73a813f1008778d3fb8a8da30f2f381bdf692/iotics-grpc-client-5.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-26 11:58:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Iotic-Labs",
"github_project": "iotics-grpc-client-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "iotics-grpc-client"
}