This project provides two Python implementations of NETCONF protocol:
netconf- A synchronous implementation using Paramiko for SSHasync_netconf- An asynchronous implementation using asyncssh
Both implementations provide client and server functionality following the NETCONF protocol.
This package uses modern Python packaging with pyproject.toml. You'll need Python 3.7 or higher.
# Install the synchronous version
pip install netconf
# Install with async support
pip install "netconf[async]"# Clone the repository
git clone https://github.com/choppsv1/netconf.git
cd netconf
# Install in development mode with all dependencies
pip install -e ".[dev,async]"For development, install with the dev extra:
pip install -e ".[dev]"This includes:
- Testing tools (pytest, pytest-cov, pytest-asyncio)
- Linting (pylint, yapf)
- Build tools (setuptools-scm, twine, wheel)
- Complete NETCONF 1.0 and 1.1 protocol support
- SSH transport via Paramiko
- Server and client implementations
- Thread-safe design
- XML-based RPCs and notifications
- Asyncio-based implementation
- SSH transport via asyncssh
- High-performance server and client
- Non-blocking I/O operations
- Compatible with Python's asyncio ecosystem
Both packages provide command-line clients:
# Synchronous client
netconf-client [options] <host> [<port>]
# Asynchronous client
async-netconf-client [options] <host> [<port>]from netconf.client import SSHClient
with SSHClient("hostname") as client:
# Get running config
result = client.get_config()
print(result)import asyncio
from async_netconf.client import SSHClient
async def main():
async with SSHClient("hostname") as client:
# Get running config
result = await client.get_config()
print(result)
asyncio.run(main())For detailed documentation, please refer to: http://netconf.readthedocs.io/
To set up a development environment:
git clone https://github.com/choppsv1/netconf.git
cd netconf
pip install -e ".[dev]"Run tests:
pytest__main__- Netconf CLI client utilitybase- Shared netconf support classeserror- Netconf error classesclient- Netconf client implementationserver- Netconf server implementationutil- Utility functions
__main__- Asynchronous netconf CLI clientbase- Async netconf support classeserror- Async netconf error classesclient- Async netconf client implementationserver- Async netconf server implementationutil- Async utility functionssimple_client- Simplified async client interface
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.