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.1.tar.gz (7.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: py2n-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 15127308255f5982732e5aeb279b14cb23c30d4c71812e7dee8f9cf49a513364
MD5 a30915943ede8d9c0f763716e88cfeb5
BLAKE2b-256 e4fce7bccf8b6cd23bc40c885f76776804e625e536860fd6dabbc3d678b8d1a0

See more details on using hashes here.

Supported by

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