# Py2N
<img src="https://user-images.githubusercontent.com/38865194/210242643-8f2cef4d-e426-4280-9263-63bee2b66eef.png" width=20% height=20%>
Asynchronous library to control [2N TelekomunikaceĀ® devices](https://www.2n.com)
**This library is under development**
## Requirements
- Python >= 3.9
- aiohttp
## Install
```bash
pip install py2n
```
## Example
```python
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())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/elektr0nisch/py2n",
"name": "py2n",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Linus Groschke",
"author_email": "linus@elektronisch.dev",
"download_url": "https://files.pythonhosted.org/packages/e4/fc/e7bccf8b6cd23bc40c885f76776804e625e536860fd6dabbc3d678b8d1a0/py2n-0.4.1.tar.gz",
"platform": "any",
"description": "# Py2N\r\n\r\n<img src=\"https://user-images.githubusercontent.com/38865194/210242643-8f2cef4d-e426-4280-9263-63bee2b66eef.png\" width=20% height=20%>\r\n\r\nAsynchronous library to control [2N Telekomunikace\u00ae devices](https://www.2n.com)\r\n\r\n**This library is under development**\r\n\r\n## Requirements\r\n\r\n- Python >= 3.9\r\n- aiohttp\r\n\r\n## Install\r\n```bash\r\npip install py2n\r\n```\r\n\r\n## Example\r\n\r\n```python\r\nfrom py2n import Py2NDevice, Py2NConnectionData\r\n\r\nimport asyncio\r\nimport aiohttp\r\n\r\nasync def main():\r\n \"\"\"Run with aiohttp ClientSession.\"\"\"\r\n async with aiohttp.ClientSession() as session:\r\n await run(session)\r\n\r\n\r\nasync def run(websession):\r\n \"\"\"Use library.\"\"\"\r\n device = await Py2NDevice.create(\r\n websession,\r\n Py2NConnectionData(\r\n host=\"192.168.1.69\",\r\n username=\"username\",\r\n password=\"password\",\r\n ),\r\n )\r\n\r\n await device.restart()\r\n\r\nasyncio.run(main())\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library for 2N\u00ae devices",
"version": "0.4.1",
"project_urls": {
"Homepage": "https://github.com/elektr0nisch/py2n"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e4fce7bccf8b6cd23bc40c885f76776804e625e536860fd6dabbc3d678b8d1a0",
"md5": "a30915943ede8d9c0f763716e88cfeb5",
"sha256": "15127308255f5982732e5aeb279b14cb23c30d4c71812e7dee8f9cf49a513364"
},
"downloads": -1,
"filename": "py2n-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "a30915943ede8d9c0f763716e88cfeb5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7663,
"upload_time": "2024-08-25T02:21:38",
"upload_time_iso_8601": "2024-08-25T02:21:38.552085Z",
"url": "https://files.pythonhosted.org/packages/e4/fc/e7bccf8b6cd23bc40c885f76776804e625e536860fd6dabbc3d678b8d1a0/py2n-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-25 02:21:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "elektr0nisch",
"github_project": "py2n",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "py2n"
}