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
py 3.11
✕ build_error
✓ 9.71s
py 3.12
✕ build_error
✓ 8.24s
py 3.13
✕ build_error
✓ 8.39s
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.fixAlways 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.fixRefer 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.fixEnsure 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.