Netlink client for asyncio
Project description
aiortnetlink
Pure-python asyncio rtnetlink client.
Getting started
Install from PyPI:
pip install aiortnetlink
Or, adding to your uv project:
uv add aiortnetlink
Example:
from aiortnetlink import NetlinkClient
async with NetlinkClient() as nl:
async for link in nl.get_links():
print(f"{link.index}: {link.name}")
The module ships with a CLI, for example if running from the repository root:
uv run aiortnetlink addr show
Supported features
Links
get_links: List all links.get_link: Lookup link by index or name.
Addresses
get_links: List all addresses.add_addr: Add IP address to link.del_addr: Remove IP address from link.
Routes
get_routes: List all routes.
Rules
get_rules: List all rules.
Notifications
recv_notification: Receive netlink notification. Notification subscription is done by passing the revelant rtnetlink groups to the netlink client.
Development
This project uses uv for project management and poe the poet to run development tasks. Linting and code formatting is done using ruff, type checking using mypy and tests using pytest.
For example to run all checks locally:
uvx --from poethepoet poe lint
To format code using ruff:
uvx --from poethepoet poe fmt
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiortnetlink-0.2.1.tar.gz.
File metadata
- Download URL: aiortnetlink-0.2.1.tar.gz
- Upload date:
- Size: 38.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7ab006239e2b922dec47a6aab5ac2578754d456e97254dee1e0987083ce5361
|
|
| MD5 |
0298913f3b42e3c8acc1267617c5d339
|
|
| BLAKE2b-256 |
07029a5afdc1a24d37d437feba28ce911eac40ea3fb13f38fee4bb5bac7d4416
|
File details
Details for the file aiortnetlink-0.2.1-py3-none-any.whl.
File metadata
- Download URL: aiortnetlink-0.2.1-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d9637d06b940e553ca0222a454283d2cf548a5a3f96cbd76de744e92ff2c1c3
|
|
| MD5 |
e27d55b2f36093bc427029778afdae4f
|
|
| BLAKE2b-256 |
f369b51165607e56e0fc88011bfdfaca56dfa26723cdd4baafb84f5edde88bde
|