Skip to main content

Python library for 2N® devices

Project description

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",
        ),
    )

    await device.restart()

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py2n-0.4.2.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file py2n-0.4.2.tar.gz.

File metadata

  • Download URL: py2n-0.4.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for py2n-0.4.2.tar.gz
Algorithm Hash digest
SHA256 102b3ab823719ada5a305d5788aa4a7be397023cc9665edadb87fa82c51afaea
MD5 36ada86c19b18f574568952bfcdccc12
BLAKE2b-256 5b1f440adfcf925e7bb8f0901998f240fd92413bcc438f825b23e3407f38c001

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page