Py2N
Asynchronous library to control 2N Telekomunikace® devices
This library is under development
Requirements
- Python >= 3.9
- aiohttp
Install
pip install py2n
Example
from py2n import Py2NDevice, Py2NConnectionData
import asyncio
import aiohttp
async def main():
"""Run with aiohttp ClientSession."""
async with aiohttp.ClientSession() as session:
await run(session)
async def run(websession):
"""Use library."""
device = await Py2NDevice.create(
websession,
Py2NConnectionData(
host="192.168.1.69",
username="username",
password="password",
# auth_method="digest", # default: "basic"
# protocol="https", # default: "http"
# ssl_verify=True, # default: False
),
)
await device.restart()
asyncio.run(main())
auth_method controls HTTP auth scheme and supports "basic" (default) and "digest". Digest auth relies on aiohttp.DigestAuthMiddleware. 2N recommends Digest Auth, especially if using plain HTTP instead of HTTPS.
ssl_verify controls TLS certificate verification for HTTPS connections. Requires the device to present a trusted server certificate (e.g. Let's Encrypt).
Metadata
Release files for py2n 0.6.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 |
|---|---|---|---|---|
| py2n-0.6.0.tar.gz | 9.0 kB | Without provenance | Details for py2n-0.6.0.tar.gz |
Release files / py2n-0.6.0.tar.gz
| Download URL | py2n-0.6.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57f9ef7879d58c147298c0591f0515457cc87a857987deba33e014c24baf1429
|
|
BLAKE2b-256 checksum How to use checksums |
2fc03d6f2e166dc1c9793cb9c4bc20df7928799f45558c8b8b175247c7ba126d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Security for py2n 0.6.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.