Registry / testing / pyats-utils

pyats-utils

JSON →
library26.5pypypiunverified

pyATS Utils is a core component of Cisco's pyATS framework, providing a collection of reusable utility functions for test automation, data manipulation, schema validation, and file operations. It's designed to support and extend the capabilities of pyATS and Genie, streamlining common tasks in network automation and testing. The current version is 26.3, and it follows a rapid release cadence, typically aligning with the broader pyATS ecosystem.

pip install pyats-utils
INSTALL
IMPORT
SIG · PYATS-UTILS
P
pyats-utils
testingpythonv26.5
Install
10.3s avg
Import
—
Disk
169MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.9–3.13
musl
3.9–3.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
✓ —
✓ 11.2s
py 3.11
✕ build_error
✓ 9.71s
py 3.12
✕ build_error
✓ 8.24s
py 3.13
✕ build_error
✓ 8.39s
py 3.9
✓ —
✓ 13.96s
169MB installed
● package 169MB
Code
Verified usage

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

Schema
✓ from pyats.utils.schema import Schema
✗ from pyats.utils.schema.base import Schema

This quickstart demonstrates how to define and use a simple schema for data validation using `pyats_utils.schema`. It shows how to import `Schema` and `validate`, define data structures with types and optional fields, and then validate sample data against the defined schema.

from pyats_utils.schema.api import validate from pyats_utils.schema.base import Schema, Any, Optional # Define a simple schema my_schema = Schema({ 'name': str, 'age': int, Optional('city'): str, 'active': bool }) # Data to validate valid_data = { 'name': 'Alice', 'age': 30, 'active': True } invalid_data = { 'name': 'Bob', 'age': 'twenty five', # Incorrect type 'active': False } # Validate data print("Validating valid_data...") try: validated = validate(data=valid_data, schema=my_schema) print(f"Validation successful: {validated}") except Exception as e: print(f"Validation failed: {e}") print("\nValidating invalid_data...") try: validated = validate(data=invalid_data, schema=my_schema) print(f"Validation successful: {validated}") except Exception as e: print(f"Validation failed: {e}")
Debug
Known issues
gotchapyATS Utils is part of a larger ecosystem. Mismatched versions between `pyats-utils`, `pyats`, and `genie` packages can lead to unexpected errors or runtime issues. It's best practice to keep all pyATS-related packages updated together.
fix
Always install/upgrade all pyATS components together, ideally using `pip install --upgrade pyats` which often pulls in compatible versions of dependencies. Verify versions with `pyats version`.
affects: All versions
breakingThe internal structure and API of `pyats-utils` modules can change between major `pyats` releases (e.g., from 23.x to 24.x, or 24.x to 25.x). While efforts are made for backward compatibility, direct imports from deep sub-modules might break.
fix
Refer to the official pyATS release notes for detailed breaking changes. Prefer importing from documented top-level APIs (e.g., `pyats_utils.schema.api`) rather than internal modules when available.
affects: Versions prior to 25.0 when upgrading to 25.0+, or prior to 26.0 when upgrading to 26.0+
gotchaSome utilities in `pyats-utils` assume the context of a pyATS testbed or run-time environment. Using them in isolation without proper setup might lead to `AttributeError` or `KeyError` if they try to access non-existent testbed attributes.
fix
Ensure that the necessary pyATS environment or objects are initialized when using utilities that rely on them. For standalone use, ensure you understand the utility's dependencies and provide mock objects or necessary configurations if required.
affects: All versions
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
pyatsrequiredMost functionalities are designed to integrate with or enhance the pyATS framework. While some utilities can be used standalone, full functionality often requires pyATS.
genieoptionalMany parsing and device interaction utilities in pyATS/pyats-utils leverage Genie for platform abstraction.
Agent activity
20 hits · last 30 days
node
18
Resources
pyats-utils — pip install pyats-utils · libregistry