Registry / testing / pyats-datastructures

pyats-datastructures

JSON →
library26.5pypypiunverified

pyATS Datastructures provides extended data structures designed to enhance network automation and testing workflows. It offers specialized objects like `DataObject`, `DataList`, `DataDict`, and `MetaData` that allow for attribute-based access, schema validation, and meta-data handling, often used within the Cisco pyATS framework for managing configuration and state data. The current version is 26.3, and it follows the pyATS release cadence, typically releasing new versions quarterly or as needed with the main pyATS framework.

pip install pyats-datastructures
INSTALL
IMPORT
SIG · PYATS-DATASTRUCTUR
P
pyats-datastructures
testingpythonv26.5
Install
1.8s avg
Import
Disk
19MB
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
✓ —
✓ 1.78s
py 3.11
✕ build_error
✓ 1.75s
py 3.12
✕ build_error
✓ 1.6s
py 3.13
✕ build_error
✓ 1.58s
py 3.9
✓ —
✓ 2.1s
19MB installed
● package 19MB
Code
Verified usage

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

DataObject
from pyats.datastructures import DataObject
from pyats import DataObject
DataList
from pyats.datastructures import DataList
DataDict
from pyats.datastructures import DataDict

This quickstart demonstrates how to create and interact with a `DataObject`, assigning attributes and converting it to a standard Python dictionary. `DataObject` provides attribute-style access and allows for nesting other `DataObject` instances.

from pyats.datastructures import DataObject # Create a DataObject data = DataObject() # Assign attributes like a regular object data.attr = 'value' data.attr_2 = 123 data.nested = DataObject() data.nested.item = 'nested_value' # Access attributes print(f"data.attr: {data.attr}") print(f"data.nested.item: {data.nested.item}") # Convert to a standard Python dictionary plain_dict = data.to_dict() print(f"Converted to dict: {plain_dict}") assert plain_dict == {'attr': 'value', 'attr_2': 123, 'nested': {'item': 'nested_value'}}
Debug
Known issues
gotchaWhile `DataObject` provides dictionary-like and attribute-like access, it does not inherit directly from `dict` or `list`. Direct use of standard dictionary/list methods like `.keys()`, `.items()`, or `.append()` on a `DataObject` instance itself will result in an `AttributeError` (unless explicitly implemented or if it contains a `DataDict`/`DataList` instance).
fix
To perform iterable operations or convert to a native Python type, use specific methods like `DataObject.to_dict()` or `DataList.to_list()`. Interact with `DataDict` or `DataList` objects embedded within the `DataObject` for their respective operations.
affects: All versions
gotchaWhen assigning a plain Python `dict` or `list` to an attribute of a `DataObject`, `pyats-datastructures` will implicitly convert them into `DataDict` or `DataList` instances. While this offers convenience, it means subsequent operations on these nested structures will follow `DataDict`/`DataList` rules, not standard `dict`/`list` behavior.
fix
Be aware of this implicit conversion. If you require a strictly plain `dict` or `list` nested within, you may need to convert it back explicitly or manage it outside the `DataObject` context. Alternatively, embrace the `DataDict`/`DataList` behavior for enhanced features.
affects: All versions
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
pyyamlrequiredYAML serialization/deserialization.
schematicsrequiredSchema validation and model definition.
diff_match_patchrequiredString differencing capabilities.
coloramarequiredCross-platform colored terminal output.
jinja2requiredTemplating for string processing.
pyats.utilsrequiredCore utility functions from the pyATS framework.
Agent activity
15 hits · last 30 days
node
12
Resources
pyats-datastructures — pip install pyats-datastructures · libregistry