Registry / testing / pyats-kleenex

pyats-kleenex

JSON →
library26.5pypypiunverified

pyATS Kleenex is a crucial component of the larger pyATS ecosystem, specifically designed for testbed preparation, cleaning, and finalization tasks. It enables network engineers to restore network devices to a known good state before or after executing automated tests, ensuring consistent testing environments. As part of the pyATS framework, it maintains a regular release cadence, often monthly or bi-monthly, aligning with overall pyATS updates. The current version is 26.3.

pip install pyats.kleenex
INSTALL
IMPORT
SIG · PYATS-KLEENEX
P
pyats-kleenex
testingpythonv26.5
Install
10.7s avg
Import
Disk
190MB
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
✓ —
✓ 11.8s
py 3.11
✕ build_error
✓ 10.25s
py 3.12
✕ build_error
✓ 8.1s
py 3.13
✕ build_error
✓ 8.6s
py 3.9
✓ —
✓ 14.68s
190MB installed
● package 190MB
Code
Verified usage

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

KleenexFileLoader
from pyats.kleenex import KleenexFileLoader
from pyats.kleenex.loader import KleenexFileLoader

The quickstart demonstrates the general approach to using pyATS Kleenex functionality. While `pyats.kleenex` is the package, the primary interaction for cleaning devices is through the `pyats clean` command-line interface. This example shows how to conceptually set up a testbed and points to the CLI for execution.

# Create a simple testbed.yaml file # devices: # csr1: # os: iosxe # type: router # connections: # cli: # protocol: ssh # ip: 10.0.0.1 # credentials: # default: # username: cisco # password: cisco # To run a clean operation using the pyats clean CLI command (recommended approach) # Assuming you have a testbed.yaml and a clean.yaml defining the clean stages # pyats clean <testbed.yaml> -clean_file <clean.yaml> # Example of a simple clean.yaml content: # clean: # csr1: # sections: # - 'power_cycle' # - 'install_image': # image: "/path/to/image.bin" # Example Python snippet to initiate a clean operation (simplified conceptual view) import os from pyats import topology from pyats.clean import clean_testbed try: # Load your testbed testbed = topology.load(os.environ.get('TESTBED_YAML', 'testbed.yaml')) device = testbed.devices['csr1'] # Example: Perform a clean operation on a device # This typically requires a separate clean.yaml file to define the stages # For a full execution, you would use pyats run job with a Python job file # that orchestrates the clean operation, or the pyats clean CLI command. # Programmatic invocation of clean (requires a clean_file argument in a real scenario) # The clean_testbed function typically takes a testbed object and a clean file path. print(f"Attempting to clean device: {device.name}") # This is a conceptual example, actual clean invocation is more complex # and often driven by EasyPy or the 'pyats clean' CLI. # For demonstration, we'll simulate a successful clean stage print(f"Device {device.name} is ready for cleaning operations.") print("To execute a full clean, use the 'pyats clean <testbed.yaml> -clean_file <clean.yaml>' CLI command.") except Exception as e: print(f"An error occurred: {e}")
kleenex --version
Debug
Known issues
deprecatedThe standalone `kleenex` CLI command is deprecated. Users should now use the `pyats clean` CLI command for testbed preparation, cleaning, and finalization tasks.
fix
Migrate any scripts or workflows using `kleenex` to `pyats clean`. Refer to the pyATS documentation for the updated `pyats clean` command syntax and options.
affects: pyATS v20.9 and newer
breakingpyATS and its components, including Kleenex, have specific Python version requirements. While PyPI lists `>=3.8`, current stable releases (e.g., 26.x) are typically incompatible with Python 3.11 and newer due to underlying dependencies.
fix
Ensure your environment uses a compatible Python version, typically Python 3.8 to 3.10. Always check the official pyATS documentation or release notes for the exact supported Python versions for your specific pyATS release.
affects: pyATS 20.x through 26.x (for Python 3.11+)
gotchapyATS does not officially support Windows platforms without the use of Windows Subsystem for Linux (WSL). Running pyATS components directly on Windows may lead to unexpected behavior or errors.
fix
Develop and run pyATS applications on Linux, macOS, or within a WSL environment on Windows. Alternatively, use official pyATS Docker images which provide a pre-configured Linux environment.
affects: All versions
deprecatedThe `pyats.async` module was renamed to `pyats.async_` in pyATS v19.0 due to `async` becoming a reserved keyword in Python 3.7. Code written for older Python versions or pyATS releases may break.
fix
Update import statements from `import pyats.async` to `import pyats.async_` in any affected code.
affects: pyATS v19.0 and newer when using Python 3.7+
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
pyatsrequiredKleenex is a sub-package and relies on the core pyATS framework for testbed management and execution.
genieoptionalOften used in conjunction with pyATS for advanced parsing and operations, though not a direct dependency of Kleenex itself, it's integral to a full pyATS testing environment.
Agent activity
12 hits · last 30 days
node
12
Resources
pyats-kleenex — pip install pyats-kleenex · libregistry