aioSENZ package
An async Python wrapper for the nVent Raychem SENZ RestAPI.
Installation
pip install aiosenz
OAuth2
This package offers an AbstractSENZAuth, where you should handle the OAuth2 tokens and provide a valid access token in get_access_token(). You can use SENZAuth if you don't want to handle the OAuth2 tokens yourself.
Grant type
SENZAuth uses the Authorization Code grant type. This requires a Client ID and Client Secret, more information is available in the RestAPI documentation.
Scopes
AioSENZ uses the restapi and offline_access scope, this is set as default in SENZAuth and should be set in the OAuth2 client if you are using the AbstractSENZAuth class. The OpenID (openid) and OpenID Profile (profile) scopes are not supported, because nVent recommends to use the RestAPI Account instead.
Example
from asyncio import run
from aiosenz import SENZAuth, SENZAPI
import httpx
async def main():
async with httpx.AsyncClient() as httpx_client:
senz_auth = SENZAuth(
httpx_client,
"YOUR_CLIENT_ID",
"YOUR_CLIENT_SECRET",
redirect_uri="http://localhost:8080/auth/callback",
)
uri, state = await senz_auth.get_authorization_url()
print("Authorization URI: ", uri)
authorization_response = input("The authorization response URL: ")
await senz_auth.set_token_from_authorization_response(authorization_response)
senz_api = SENZAPI(senz_auth)
thermostats = await senz_api.get_thermostats()
for thermostat in thermostats:
print(f"{thermostat.name} temperature: {thermostat.current_temperatue}")
await senz_auth.close()
run(main())
Metadata
Release files for aiosenz 1.0.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 |
|---|---|---|---|---|
| aiosenz-1.0.0.tar.gz | 18.5 kB | Without provenance | Details for aiosenz-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiosenz-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for aiosenz-1.0.0-py3-none-any.whl |
Total release size: 39.6 kB
Release files / aiosenz-1.0.0.tar.gz
| Download URL | aiosenz-1.0.0.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f078462bcd7170dc71abe4ea3bf21318ec0a946fdf4df4a354f1210d70c03ba0
|
|
BLAKE2b-256 checksum How to use checksums |
de4b2616a878e3632437d836816ceb748ee936d7ef8a6238dba426d639cd1d5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.7
|
Release files / aiosenz-1.0.0-py3-none-any.whl
| Download URL | aiosenz-1.0.0-py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19b4098b1bbf759c7a19dbb65236e5ac737267cd8970835afe764ea8bed36a2f
|
|
BLAKE2b-256 checksum How to use checksums |
ac805716f5902ac61dc1a65eff90672f7f3dbb7256f818153d1baf59193fb061
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.7
|
Security for aiosenz 1.0.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.