Registry / http-networking / asyncstdlib

asyncstdlib

JSON →
library3.14.0pypypi✓ verified 24d ago

asyncstdlib provides async equivalents for functions and classes found in Python's standard library modules like itertools, functools, contextlib, builtins, and os. It aims to make writing asynchronous code more concise and familiar by mirroring the API of their synchronous counterparts. The current version is 3.14.0, maintaining feature parity with Python 3.14. New major versions are typically released to align with new Python releases.

pip install asyncstdlib
INSTALL
IMPORT
SIG · ASYNCSTDLIB
A
asyncstdlib
http-networkingpythonv3.14.0
Install
1.6s avg
Import
50ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.14.0 · 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
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.052s · 18.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.048s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

map
from asyncstdlib import map
from asyncstdlib.itertools import map as amap

This quickstart demonstrates using `asyncstdlib`'s async versions of `map`, `filter`, and `anext` with an async generator. It highlights how to apply common iteration patterns in an asynchronous context.

import asyncio import asyncstdlib as a async def async_counter(limit: int): """An async generator that yields numbers up to a limit.""" for i in range(limit): await asyncio.sleep(0.01) # Simulate async work yield i async def main(): print("\nMapping values (doubling):") doubled_values = a.itertools.map(lambda x: x * 2, async_counter(5)) async for item in doubled_values: print(item) print("\nFiltering values (evens only):") even_values = a.itertools.filter(lambda x: x % 2 == 0, async_counter(6)) async for item in even_values: print(item) print("\nConsuming with anext:") it = a.builtins.aiter(async_counter(3)) print(await a.builtins.anext(it)) print(await a.builtins.anext(it)) if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
gotchaMixing `asyncstdlib` functions with built-in or synchronous standard library functions (e.g., `itertools.map` on an async iterable) will lead to `TypeError` or incorrect behavior, as asyncstdlib functions expect and return async iterables/awaitables.
fix
Always use the `asyncstdlib` equivalent (e.g., `asyncstdlib.itertools.map`, `asyncstdlib.builtins.anext`) when working with async generators and iterables.
affects: All versions
breakingIn `v3.13.3`, the signatures and behavior of `asyncstdlib.itertools.islice` and `asyncstdlib.itertools.accumulate` were updated to match their synchronous `itertools` counterparts more closely. This primarily affects `islice` overloads and `accumulate`'s `initial` parameter, potentially causing subtle breaking changes if your code relied on previous divergent behavior.
fix
Review code using `islice` and `accumulate` and adjust parameter passing or expectations to align with the standard `itertools` behavior.
affects: >=3.13.3
gotchaAs of `v3.13.3`, `asyncstdlib.itertools.tee` instances now share an internal buffer for improved efficiency, mirroring `itertools.tee` in CPython. While generally a performance enhancement, this can subtly change behavior if you were relying on independent buffering or specific mutation patterns of yielded items across `tee` branches in earlier versions.
fix
Understand that `tee` iterators consume from a shared underlying iterable and buffer. Ensure your logic handles this standard `tee` behavior, which typically implies immutable consumption.
affects: >=3.13.3
deprecated`asyncstdlib` versions from `3.12.1` onwards no longer support Python 3.6 and 3.7. The `requires_python` specification is `~=3.8`.
fix
Upgrade your Python environment to 3.8 or newer.
affects: >=3.12.1
Upgrade
Version history
3.14.0latest on PyPI · released Mar 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
20
OpenAI (training)
1
Resources
asyncstdlib — pip install asyncstdlib · libregistry