async_generator
Async generators and context managers for Python 3.5+
What it is and what it does
async_generator backports async generator and async context manager syntax from Python 3.6+ down to Python 3.5. It lets you write async generator functions using decorators (@async_generator and @asynccontextmanager) and the await yield_() pattern, enabling code that would otherwise only work on newer Python versions to run on 3.5.
The package has no runtime dependencies and installs cleanly. It was maintained by the Trio project and works with any async library. However, the project is abandoned—the last release was 2018-08-01 and the last commit 2020-08-24—so it receives no updates, security patches, or maintenance.
Use it for:
- Maintain async code compatibility with Python 3.5 in legacy projects that cannot upgrade their minimum version.
- Use native async generator syntax in Python 3.5 codebases without rewriting to older callback-based patterns.
- Implement async context managers with @asynccontextmanager decorator on Python 3.5 before it was added to the standard library.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides async generators and async context managers for Python 3.5, backporting features from Python 3.6+ that enable writing async generator functions with native syntax.
No, unless you are actively maintaining Python 3.5 code. The package is abandoned and unmaintained since 2020-08-24. If you control the Python version, upgrade to 3.6+ and use native async generators instead.
Install
async-generator on PyPI
pip
pip install async-generatoruv
uv add async-generatorpoetry
poetry add async-generatorInstalling async_generator
Before you install
Low friction installation with no runtime dependencies. However, the package is abandoned as of 2020-08-24 with no releases since 2018-08-01, so it receives no active maintenance or security updates.
License in practice
Licensed under MIT or Apache License 2.0 (permissive dual license), giving you freedom to use, modify, and distribute the package with minimal restrictions.
Quickstart
pip install async_generator
from async_generator import async_generator, yield_
@async_generator
async def load_json_lines(stream_reader):
async for line in stream_reader:
await yield_(line)
Requires Python 3.5 or later; primarily useful for Python 3.5 codebases since Python 3.6+ has native async generator syntax.
Verify before relying
- Whether the package remains compatible with modern Python versions beyond those listed in classifiers (3.5–3.6).
- Whether async_generator is still necessary given that Python 3.5 reached end-of-life.
Package facts
| License | MIT -or- Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,935 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,221,111/month — #2,137 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: async_generator-1.10-py3-none-any.whl
Keywords: async
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
async-exit-stackProvides AsyncExitStack, a backport of Python…
permissive · top 15,000 on PyPI
pytest-aioA pytest plugin that automatically runs async…
permissive · top 15,000 on PyPI
greenbackAllows you to call async functions from…
permissive · top 5,000 on PyPI
contextlib2contextlib2 backports the Python standard…
permissive · top 5,000 on PyPI
pytest-trioA pytest plugin that enables testing of async…
permissive · top 15,000 on PyPI
flake8-asyncA flake8 plugin that detects async-related…
permissive · top 15,000 on PyPI
unasyncTransforms asynchronous Python code into…
permissive · top 15,000 on PyPI
aioitertoolsProvides async-compatible versions of Python's…
permissive · top 1,000 on PyPI
asyncguiAsyncGui provides structured concurrency…
permissive · top 15,000 on PyPI
synchronicityWraps async functions, generators, and classes…
permissive · top 1,000 on PyPI