Registry / devops / nmcli
library1.7.0pypypi✓ verified 83d ago

A Python wrapper library for the network-manager CLI client (nmcli). Current version 1.7.0, requires Python >=3.7. Maintained, with frequent releases adding new features.

pip install nmcli
INSTALL
IMPORT
SIG · NMCLI
N
nmcli
devopspythonv1.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nmcli
import nmcli
from nmcli import nmcli
The top-level is a module, not a submodule.

Quick start: import nmcli and use methods like connection.show_all() and device.wifi()

import nmcli # Show all network connections connections = nmcli.connection.show_all() for conn in connections: print(conn.name, conn.type) # Get device wifi list import os os.environ.get('WIFI_PASSWORD', '') # dummy auth wifi_list = nmcli.device.wifi() for ap in wifi_list: print(ap.ssid, ap.signal)
nmcli --version
Debug
Known issues
breakingIn v1.4.0, nmcli.general was fixed to work with nmcli client >= 1.48.x. Code relying on older parsing may break if the nmcli output format changed.
fix
Upgrade to >=1.4.0 and test general methods like nmcli.general.status()
affects: <1.4.0
gotchaThis library is NOT async. Many users try to use it with asyncio and get RuntimeError due to blocking subprocess calls.
fix
Run synchronous calls in a thread pool executor if using asyncio
affects: all
gotchaMethods like wifi_connect() require root privileges or appropriate polkit permissions. Common failure due to missing D-Bus authorization.
fix
Run the script as root or configure polkit to allow unprivileged users to manage networking
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'nmcli'
Library not installed or installed in a different environment.
fix
Run: pip install nmcli
nmcli.connection.show() AttributeError: 'Connection' object has no attribute 'show'
Incorrect import or old version. show() was added in v1.0.0, but as a module function, not a method on Connection objects.
fix
Use: nmcli.connection.show() directly, not on a connection instance.
RuntimeError: There is no current event loop in thread 'MainThread'.
Trying to use asyncio.run() or similar without proper async wrapper around synchronous library.
fix
Wrap synchronous calls: await loop.run_in_executor(None, nmcli.connection.show) or use a sync context.
Upgrade
Version history
1.7.0latest on PyPI · released Jan 3, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
nmcli — pip install nmcli · libregistry