Registry / devops / pyats-async

pyats-async

JSON →
library26.5pypypiunverified

pyATS Async is a sub-component of the pyATS ecosystem, a Python-based framework by Cisco specializing in data-driven and reusable network testing and automation. It wraps Python's multiprocessing module to enable asynchronous (parallel) execution of arbitrary functions. The library, currently at version 26.3, is actively maintained with a frequent release cadence, often monthly or bi-monthly.

pip install pyats.async
INSTALL
IMPORT
SIG · PYATS-ASYNC
P
pyats-async
devopspythonv26.5
Install
5.7s avg
Import
Disk
65MB
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
✓ —
✓ 6.38s
py 3.11
✕ build_error
✓ 5.45s
py 3.12
✕ build_error
✓ 4.3s
py 3.13
✕ build_error
✓ 4.6s
py 3.9
✓ —
✓ 7.53s
65MB installed
● package 65MB
Code
Verified usage

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

pcall
from pyats.async import pcall
from pyats.async import pcall

This quickstart demonstrates how to use `pcall` from `pyats.async_` to execute a CPU-bound function across multiple processes in parallel. It includes a synchronous comparison to highlight the benefits of parallel execution for such tasks.

import time from pyats.async_ import pcall def my_cpu_bound_task(item): """A sample CPU-bound task that simulates work.""" # print(f"Starting task for item {item}...") # Uncomment to see individual task starts time.sleep(1) # Simulate some CPU-intensive work result = item * item # print(f"Finished task for item {item}, result: {result}") # Uncomment to see individual task finishes return result if __name__ == "__main__": items_to_process = [1, 2, 3, 4, 5] print("\n--- Running tasks in parallel with pcall ---") # pcall executes the function in parallel processes and returns results in order. parallel_results = pcall(my_cpu_bound_task, *items_to_process) print(f"All parallel tasks completed. Results: {parallel_results}") print("\n--- Running tasks synchronously for comparison ---") sync_results = [my_cpu_bound_task(item) for item in items_to_process] print(f"All synchronous tasks completed. Results: {sync_results}")
pyats --version
Debug
Known issues
breakingThe `pyats.async` module was renamed to `pyats.async_` starting with pyATS v19.0 (March 2019) to resolve conflicts with the `async` keyword introduced in Python 3.7. Code using the old import path will break on Python 3.7 and newer.
fix
Update your import statements from `from pyats.async import pcall` to `from pyats.async_ import pcall`.
affects: <19.0
gotchapyATS and its sub-components, including `pyats.async`, do not officially support Windows operating systems. It is designed for and tested on Linux and Mac systems. Running on Windows may lead to unexpected behavior, installation failures, or runtime errors.
fix
Run `pyats.async` applications on a supported Linux or Mac environment, or within a Linux-based virtual machine or Docker container on Windows.
affects: All versions
gotcha`pyats.async` leverages Python's multiprocessing for true parallelism, which is ideal for CPU-bound tasks. It should not be confused with `asyncio`, which is designed for I/O-bound (non-blocking) tasks and uses a single-threaded event loop. Using `pyats.async` for I/O-bound operations might not provide the expected performance benefits, and combining it incorrectly with `asyncio` can introduce complexity.
fix
Understand the distinction between multiprocessing (CPU-bound) and asyncio (I/O-bound). Use `pyats.async` primarily for tasks that will benefit from parallel execution across multiple CPU cores.
affects: All versions
Upgrade
Version history
26.5latest on PyPI · released May 28, 2026
Audit
Dependencies
pythonrequiredRequired Python version
Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
pyats-async — pip install pyats-async · libregistry