ncclient
Python library for NETCONF clients
What it is and what it does
ncclient provides a Python API for building NETCONF clients that communicate with network devices using the NETCONF protocol over SSH. It abstracts the complexity of NETCONF message framing, XML parsing, and RPC handling, allowing developers to retrieve device configuration, execute commands, and manage network state programmatically. The library includes device-specific handlers for major vendors including Juniper, Cisco, Huawei, Alcatel Lucent, Ciena, H3C, and HP Comware, which adapt NETCONF behavior to vendor-specific extensions and quirks.
The package depends on lxml for XML processing and paramiko for SSH transport. It supports Python 3.7 through 3.13 and is actively maintained. Common use cases include fetching running configuration from devices, executing RPC operations, subscribing to NETCONF notifications, and integrating device management into automation workflows. The library handles NETCONF 1.0 and 1.1 protocol versions and includes support for call-home and YANG 1.1 actions.
Use it for:
- Retrieve and backup running configuration from network devices via NETCONF get-config operations.
- Automate network device configuration changes by sending edit-config RPC operations programmatically.
- Subscribe to device notifications and events via NETCONF subscriptions for real-time monitoring.
- Build multi-vendor network management tools using device handlers to normalize vendor-specific behavior.
- Integrate NETCONF operations into infrastructure-as-code or network automation pipelines.
- Execute vendor-specific RPC operations through a unified Python interface.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ncclient is a Python library that implements NETCONF client functionality, enabling programmatic configuration and monitoring of network devices via the NETCONF protocol.
Yes. ncclient is a mature, actively maintained library with no known vulnerabilities, permissive Apache-2.0 licensing, and low install friction. It is the standard Python NETCONF client for network automation and device management. Install it if you need to programmatically manage NETCONF-capable network devices; the only prerequisite is having libxml2 and libxslt system libraries available.
Install
ncclient on PyPI
pip
pip install ncclientuv
uv add ncclientpoetry
poetry add ncclientInstalling ncclient
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release and ongoing repository activity. Depends on lxml and paramiko, both stable and widely-used libraries.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
Quickstart
pip install ncclient
from ncclient import manager
with manager.connect(host=host, port=830, username=user, hostkey_verify=False) as m:
config = m.get_config(source='running').data_xml
print(config)
Requires libxml2 and libxslt system libraries (libxml2-dev and libxslt1-dev on Debian/Ubuntu); SSH access to a NETCONF-enabled device on port 830.
Verify before relying
- Production readiness and maturity level of device handler implementations across all supported vendors.
- Performance characteristics and scalability limits for large-scale device management operations.
- Current test coverage percentage and CI/CD pipeline status beyond the mention of increased test coverage in v0.6.10.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — lxml, paramiko |
| Maintenance | actively maintained — 152 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 938,252/month — #4,687 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ncclient-0.7.1-py3-none-any.whl
Keywords: Cisco NXOS Optimization, Juniper Optimization, NETCONF, NETCONF Python client
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
netconf-clientA NETCONF client library for Python that…
permissive · top 15,000 on PyPI
netconf-console2A command-line and interactive console tool for…
permissive · top 15,000 on PyPI
scrapliscrapli is a Python library for connecting to…
permissive · top 15,000 on PyPI
pygnmiPure Python gNMI client for querying and…
permissive · top 15,000 on PyPI
yang.connectorProvides NETCONF and gRPC/GNMI client…
permissive · top 15,000 on PyPI
python-nmapPython wrapper for the nmap port scanner that…
copyleft · top 15,000 on PyPI
napalmNAPALM provides a unified Python API to…
permissive · top 15,000 on PyPI
pynetboxPynetbox is a Python client library for…
permissive · top 5,000 on PyPI
pyats.connectionsProvides device connection abstraction and base…
permissive · top 15,000 on PyPI
genie.libs.confGenie Libs Conf provides Python object-based…
permissive · top 15,000 on PyPI