skillfed

librouteros

Python implementation of MikroTik RouterOS API

librouteros v4.1.1 146.1K downloads/30d#11,108 on PyPI265
Copyleft license GPL-2.0-or-later Active released

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 librouteros

uv

uv add librouteros

poetry

poetry add librouteros

Installing 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

mikrotik routeros api clientpython routeros controlmikrotik device managementrouteros network automationmikrotik api library
network-automationmikrotikdevice-management

More Networking packages