Unicon is a Python package that provides a unified connection experience to network devices via typical command-line management interfaces (CLI). It serves as the standard CLI connection implementation within the Cisco pyATS framework, offering direct and proxied connections, expect-like programming, and multi-vendor support through an agnostic API. Initially developed internally by Cisco, it was released publicly in late 2017 through Cisco DevNet. [1, 2, 12] The current version is 26.3, released on April 2, 2026, and the project maintains an active release cadence, often aligned with the broader pyATS/Genie framework releases. [2, 23]
pip install uniconVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to establish a basic CLI connection to a network device using Unicon, execute a command, and then disconnect. It uses environment variables for sensitive credentials for security and easy testing. [12]
Ensure your Python environment is 3.8 or higher. Upgrade Python or activate a compatible virtual environment. [2]
Install `unicon.plugins` (`pip install unicon.plugins`). Refer to Cisco DevNet documentation for supported platforms and necessary plugins for your specific device. [1, 12]
Start with common error patterns (e.g., `^%Error`, `^% Invalid`, `Timeout`). Test against various error conditions on your target devices. Use regular expressions carefully and consider broad patterns like `%.*?%` for general error messages, then refine to avoid false positives. Consult device documentation for expected error messages. [24]