Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frostspb/aio_api_ros
Async implementation Mikrotik api (apiros)
https://github.com/frostspb/aio_api_ros
apiros asyncio mikrotik mikrotik-api python3 routeros-api
Last synced: 2 months ago
JSON representation
Async implementation Mikrotik api (apiros)
- Host: GitHub
- URL: https://github.com/frostspb/aio_api_ros
- Owner: frostspb
- License: mit
- Created: 2019-03-10T16:12:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T08:03:10.000Z (almost 2 years ago)
- Last Synced: 2024-10-03T17:35:12.796Z (3 months ago)
- Topics: apiros, asyncio, mikrotik, mikrotik-api, python3, routeros-api
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 23
- Watchers: 2
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aio_api_ros
[![Join the chat at https://gitter.im/aio_api_ros/community](https://badges.gitter.im/aio_api_ros/community.svg)](https://gitter.im/aio_api_ros/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![PyPI version](https://badge.fury.io/py/aio-api-ros.svg)](https://badge.fury.io/py/aio-api-ros)
[![Downloads](https://pepy.tech/badge/aio-api-ros)](https://pepy.tech/project/aio-api-ros)
[![star this repo](http://githubbadges.com/star.svg?user=frostspb&repo=aio_api_ros&style=flat)](https://github.com/frostspb/aio_api_ros)
[![fork this repo](http://githubbadges.com/fork.svg?user=frostspb&repo=aio_api_ros&style=flat)](https://github.com/frostspb/aio_api_ros/fork)async implementation Mikrotik api
**Installation**
```
pip install aio_api_ros
```**Example of usage**
*Single connection*
```python
import asyncio
from aio_api_ros import create_rosapi_connectionasync def main():
mk = await create_rosapi_connection(
mk_ip='127.0.0.1',
mk_port=8728,
mk_user='myuser',
mk_psw='mypassword'
)mk.talk_word('/ip/hotspot/active/print')
res = await mk.read()
print(res)
mk.close()if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()```
*Simple connections pool*
```pythonimport asyncio
from aio_api_ros import create_rosapi_simple_poolasync def main():
mk = await create_rosapi_simple_pool(
mk_ip='127.0.0.1',
mk_port=8728,
mk_user='myuser',
mk_psw='mypassword',
max_size=4
)await mk.talk_word('/ip/hotspot/active/print')
res = await mk.read()
print(res)
mk.close()if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()```