Python wrapper for the Global Sensor Networks API
===============================
.. contents:: **Table of Contents**
-------------------------
Installation
-------------------------
> pip install gsn
-------------------------
Usage
-------------------------
The wrapper uses the `sanction`_ Oauth2 library to authenticate against GSN services.
Before starting you must create a "client" on GSN services and get the client_id, client_secret and redirect_uri.
As we will be using client_credentials, the client must be linked to the user from which it will inherit the access rights.
The value of redirect uri is not used, but must nevertheless match.
Then in your python code, you can use it this way::
> import gsn
> a = gsn.API(service_url="http://localhost:9000/ws", client_id="client", client_secret="secret", redirect_uri="http://localhost")
> s = a.get_latest_values("push")
> s.values = [[1469959498000, 18]]
> r = a.push_values(s)
.. _sanction: https://github.com/demianbrecht/sanction
Sensor object
===============================
This object abstract the json representation used by GSN for the stream elements. It has the following fields:
* fields: list of triples representing the name, type and units
* name: name of the sensor
* values: list of lists. The inner lists must have the same size as the fields list and represent the data of a stream element.
* location: (optional) a triple representing the location of the sensor as latitude, longitude, altitude.
=======
CHANGES
=======
v0.2.0
-------
* adding refresh token support
* automatically tracking the expiration of access token and refreshing if necessary
v0.1.0
-------
* initial release
* supports querying the latest values and pushing data
* compatible with GSN v2.0.0
Metadata
Release files for gsn 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gsn-0.2.0.tar.gz | 4.7 kB | Without provenance | Details for gsn-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gsn-0.2.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for gsn-0.2.0-py2.py3-none-any.whl |
Total release size: 10.6 kB
Release files / gsn-0.2.0.tar.gz
| Download URL | gsn-0.2.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50920cd918e0f69a3880eabbc1cabec55025c360ed91aa574fde01e990fa1a52
|
|
BLAKE2b-256 checksum How to use checksums |
56a6d756a03c02b87401bd441e1fb60e273413a4698e427907325f1f8c0861dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / gsn-0.2.0-py2.py3-none-any.whl
| Download URL | gsn-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9a790d9f11faa14c355f5417215be7f78ef9248035c1457982821ecba82899a0
|
|
BLAKE2b-256 checksum How to use checksums |
3de9c42b997c22bd9cd14225f8e3a8f315e9f2489318869c7510d3162262996f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for gsn 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.