Package: iotics-grpc-client
Iotics gRPC Python ClientA Python library for interacting with Iotics API.Usage and Version Compatibility with Iotics host:iotics-grpc-client-pyiotics-hostpip install iotics-grpc-client~=5.0>= 6pip install iotics-grpc-client~=4.0>= 6pip install iotics-grpc-client~=3.0>= 6pip install iotics-grpc-client~=2.0>= 5pip install iotics-grpc-client~=0.10.0>= 4ExamplesConfiguring identityTo run examples, either set up required environment variables or create an.envfile with the following values. For
more information on the meaning of these values and how to create them, consulthttps://docs.iotics.com/docs/identity-api-and-credentialsRequired:SPACE- Domain name of the IOTICSpace with which to communicate. The scheme can be omitted, eg. examplecorp.
iotics.spaceUSER_DID- Identity of the userAGENT_DID- Identity of the agent authorised to operate on the user's behalfAGENT_KEY_NAME-secretvalue used to (re)create multiple key pairsAGENT_NAME- registered identity name that can be used to e.g. identify public keysAGENT_SECRET-secretvalue, the agent's private keyOptional: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 30Running example scriptsNext, create and activate your virtual environment and run any of the scripts in theexamplesdirectory,
e.g.:makedeps-py
.env/bin/activate
pythonexamples/search_twin_models.pyFAQsInstalling on Raspberry PI get: Import error GLIBC_2.33 not foundIf 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.ImportError:/lib/arm-linux-gnueabihf/libc.so.6:version'GLIBC_2.33'notfound(requiredby/home/pi/work/starting/iotics-grpc-client-py/env/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so)ContributingInstalling dependencies and generating gRPC clientTo satisfy all dependencies, lint proto files and regenerate client files (inside a Docker container):makebuildTo 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):dockerrun--rm-dit--nameiotics-grpc-client-py-builderiotics-grpc-client-py-builder/bin/bash
dockercpiotics-grpc-client-py-builder:/bin/protoc-gen-python_grpcenv/bin/protoc-gen-python_grpc
dockerstopiotics-grpc-client-py-builder
makegenerateTo update the Iotics API version and regenerate client(proto files are submoduled in./iotics-api.git/fromIotics APIrepo):_ver=vX.X.X
makeGIT_TAG=$_verdeps-proto-updatebuild# Address usages of the new client in `src`, update "Unreleased" section in CHANGELOG.md, then:gitaddCHANGELOG.mdiotics-api.gitsrc
gitcommit-m"Update Iotics API to$_ver"# Push your branch and create a PROthermakecommands:clean- remove artifacts created inside the project.deps-*- install specific requirements if missing.deps-*-update- update specific requirements when applicable.PRsShould contain a summary of the changes inCHANGELOG.mdunder the "Unreleased" section.VersioningThis package adheres toSemantic VersioningReleasingUpdate package version insetup.cfgfor the release:UpdateCHANGELOG.md(move notes from unreleased section, ensure right tags are used, etc.)
and any other files as needed.Commit changes and create aPR.Once PR is merged manually run theCreate Draft Release GitHub Action, this will create a tag with the version in setup.py and create a draft release inreleases.Update the release's information and press the publish button on the release to publish it.ThePublish GitHub Actionwill create a package and will publish it toPyPI.LicenseCopyright © 2022 IOTIC LABS LTD.info@iotics.com. All rights reserved. Licensed under the Apache License, Version 2.0. SeeLICENSEin the project root for license information.