Registry / devops / unicon-plugins

unicon-plugins

JSON →
library26.5pypypiunverified

Unicon Plugins is a component of the Cisco pyATS framework, providing extensible platform support and services for the Unicon Connection Library. It enables unified command-line interface (CLI) connection experiences to various network devices, leveraging expect-like programming for multi-vendor support and seamless handling of CLI modes. Originally developed internally by Cisco, it was open-sourced in late 2017 through Cisco DevNet. The current version is 26.3, with releases typically aligning with the pyATS framework's frequent updates, often on a monthly or bi-monthly cadence.

pip install unicon unicon-plugins
INSTALL
IMPORT
SIG · UNICON-PLUGINS
U
unicon-plugins
devopspythonv26.5
Install
3.6s avg
Import
Disk
68MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v26.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 3.8s
py 3.11
✕ build_error
✓ 3.35s
py 3.12
✕ build_error
✓ 3.03s
py 3.13
✕ build_error
✓ 3.13s
py 3.9
✓ —
✓ 4.55s
68MB installed
● package 68MB
Code
Verified usage

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

Connection
from unicon import Connection
Unicon plugins extend the base unicon.Connection class. Users interact with the Connection object from the 'unicon' package, and the relevant plugins are automatically loaded based on device OS/platform.

This quickstart demonstrates how to establish a basic CLI connection to a network device using `unicon.Connection`, leveraging the plugins to handle device-specific interactions. It uses environment variables for credentials, which is a common practice in automation. For a real environment, device details are typically managed via a pyATS Testbed YAML file.

import os from unicon import Connection # Example: Connecting to an IOS XE device # In a real scenario, device details and credentials would typically come from a pyATS testbed YAML file. # For a quick start, we'll simulate a direct connection. hostname = os.environ.get('DEVICE_HOSTNAME', 'your_device_ip_or_hostname') username = os.environ.get('DEVICE_USERNAME', 'admin') password = os.environ.get('DEVICE_PASSWORD', 'Cisco123') enable_password = os.environ.get('DEVICE_ENABLE_PASSWORD', 'Cisco123') # Instantiate a connection object for an IOSXE device # The 'os' argument directs Unicon to load the appropriate plugin. # Other parameters like 'platform' and 'model' can further refine plugin selection. try: print(f"Attempting to connect to {hostname} (OS: iosxe)...") connection = Connection( hostname=hostname, os='iosxe', start=['ssh {username}'], # Specifies how to start the connection log_file='unicon_connection.log', # Optional: logs interaction init_exec_commands=['terminal length 0', 'terminal width 0'], # Initial commands to run custom_callbacks={ 'password': lambda: password, 'enable_password': lambda: enable_password } ) connection.connect() print(f"Successfully connected to {hostname}") # Execute a command output = connection.execute('show version') print("\n--- show version output ---\n") print(output[:500]) # Print first 500 characters of output print("\n---------------------------") # Configure the device (example - requires 'configure' service for the plugin) # config_commands = ['interface Loopback100', 'description Test Loopback'] # print(f"\nAttempting to configure: {config_commands}") # connection.configure(config_commands) # print("Configuration applied.") except Exception as e: print(f"Connection failed: {e}") finally: if 'connection' in locals() and connection.is_connected(): connection.disconnect() print(f"Disconnected from {hostname}")
unicon --version
Debug
Known issues
breakingSupport for Python 3.6 ended in April 2022. Users must migrate to Python versions 3.7, 3.8, 3.9, or 3.10 as pyATS (and thus Unicon Plugins) no longer supports 3.6.
fix
Upgrade your Python environment to version 3.7 or newer.
affects: <= 22.5
gotchaAccurate specification of 'os', 'platform', and 'model' is crucial for Unicon to load the most precise connection plugin. Incorrect or generic values might lead to fallback plugins, potentially causing unexpected behavior or missing device-specific features.
fix
Ensure your device definitions (e.g., in pyATS testbed YAML) are accurate and reflect the exact OS, platform, and model of your network devices. Consult Unicon's supported platforms documentation.
affects: All
deprecatedThe 'fxos/ftd' plugin has been deprecated. Users should transition to using other available 'fxos' plugins for FTD devices.
fix
Update your device configurations to use a currently supported 'fxos' plugin instead of 'fxos/ftd'.
affects: All
gotchaWhen developing new plugins, ensure all mandatory files (like `__init__.py`) are present and correctly structured within your plugin folder. Missing or improperly defined files can prevent auto-discovery and loading of your custom plugin.
fix
Follow the Unicon plugin development guidelines, starting with cloning existing plugin examples to ensure correct structure and mandatory files are in place.
affects: All
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
uniconrequiredThis package is the plugin component of Unicon and requires the main unicon library for core functionality.
pyyamlrequiredRequired for configuration and data handling.
PrettyTablerequiredUsed for formatted output in some utilities.
cryptographyrequiredRequired for secure communication (e.g., SSH). Version 43.0 or higher is specified.
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources