librouteros
Python implementation of MikroTik RouterOS API
What it is and what it does
librouteros provides a Python interface to MikroTik RouterOS devices via their API. It abstracts the low-level protocol details, allowing developers to query and configure network settings, interfaces, firewall rules, and other RouterOS features programmatically rather than through the web UI or SSH.
The package has been in development since 2016 and is actively maintained. It carries no runtime dependencies beyond Python itself, making it lightweight to install. The copyleft license means it's suitable for open-source and internal projects but requires careful consideration in proprietary contexts.
Use it for:
- Automate bulk configuration changes across multiple MikroTik devices in a network.
- Build monitoring dashboards that query RouterOS statistics and interface status in real time.
- Integrate MikroTik device management into larger network orchestration or infrastructure-as-code workflows.
- Script routine maintenance tasks like backup, firewall rule updates, or user provisioning on RouterOS systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
librouteros is a Python client library for the MikroTik RouterOS API, enabling programmatic control and configuration of MikroTik network devices.
Yes, if you need to programmatically manage MikroTik RouterOS devices and accept the GPL-2.0-or-later copyleft license. The package is actively maintained, has no external dependencies, installs easily, and is in the top 15000 PyPI packages by download volume. Verify that your use case aligns with the copyleft terms before adoption.
Install
librouteros on PyPI
pip
pip install librouterosuv
uv add librouterospoetry
poetry add librouterosInstalling librouteros
Before you install
Low install friction with a pure-Python wheel. The package is actively maintained with a recent release and steady commit history, supporting current Python versions.
License in practice
Licensed under GPL-2.0-or-later (copyleft). Any derivative work or bundled distribution must be released under compatible terms; proprietary applications cannot incorporate this library without licensing implications.
Quickstart
pip install librouteros
from librouteros import RouterOS
router = RouterOS(host='router.local', username='admin', password='pass')
router.connect()
result = router.query('/interface/print')
Requires Python 3.10.0 or later. A MikroTik RouterOS device with API access enabled is needed to connect to.
Verify before relying
- Whether the library supports all RouterOS API endpoints or a specific subset of commands.
- Performance characteristics when managing large numbers of devices or high-frequency queries.
- Whether async/concurrent operations are supported or if connections are synchronous only.
Package facts
| License | GPL-2.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 65 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 146,118/month — #11,108 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: librouteros-4.1.1-py3-none-any.whl
Keywords: mikrotik, routeros, api
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
nmclinmcli is a Python wrapper for the…
permissive · top 15,000 on PyPI
python-roborockControl Roborock vacuum cleaners online and…
permissive · top 15,000 on PyPI
meross-iotA Python library for controlling Meross IoT…
permissive · top 15,000 on PyPI
python-otbr-apiProvides a Python client to interact with an…
permissive · top 15,000 on PyPI
msmart-ngA Python library for discovering and…
permissive · top 15,000 on PyPI
python-fullykioskProvides a Python interface to the Fully Kiosk…
permissive · top 15,000 on PyPI
aiowebostvAsync Python library for controlling LG…
permissive · top 15,000 on PyPI
device-detectorParses user agent strings and client hints to…
unclear · top 15,000 on PyPI
pylutron-casetaA Python API for controlling Lutron Caséta…
permissive · top 15,000 on PyPI
aiolifxaiolifx is an asyncio-based Python library for…
permissive · top 15,000 on PyPI