A client library for accessing gnista.io
Project description
gnista-library
A client library for accessing gnista.io
Tutorial
Create new Poetry Project
Navigate to a folder where you want to create your project and type
poetry new my-gnista-client
cd my-gnista-client
Add reference to your Project
Navigate to the newly created project and add the PyPI package
poetry add gnista-library
Your first DataPoint
Create a new file you want to use to receive data this demo.py
from gnista_library import GnistaConnection, GnistaDataPoint
connection = GnistaConnection()
dataPoint = GnistaDataPoint(connection=connection)
data = dataPoint.get_data_point(data_point_id="DATA_POINT_ID")
print(data)
You need to replace the DataPointId
with an ID from your gnista.io workspace.
For example the DataPointId of this DataPoint https://aws.gnista.io/secured/dashboard/datapoint/4684d681-8728-4f59-aeb0-ac3f3c573303
is 4684d681-8728-4f59-aeb0-ac3f3c573303
making your line read data = dataPoint.get_data_point(id="4684d681-8728-4f59-aeb0-ac3f3c573303")
Run and Login
Run your file in poetry's virtual environment
$ poetry run python demo.py
2021-09-02 14:51.58 [info ] Authentication has been started. Please follow the link to authenticate with your user: [gnista_library.gnista_connetion] url=https://aws.gnista.io/authentication/connect/authorize?client_id=python&redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Fhome&response_type=code&scope=data-api%20openid%20profile%20offline_access&state=myState
In order to login copy the url
into your Browser and Login to gnista.io if you use aws.gnista.io you can use this link
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gnista_library-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e4d0e60dd586e22c7480b3dfe43b4829cc6344c1c14cb7b83aa4af39a7ccc11 |
|
MD5 | f23bfcd379a3d68334b3670814c356fb |
|
BLAKE2b-256 | 5226ef0a5fe020d181fca0539ae8604e4d56ce96000be0e4f3445f9677449998 |