skillfed

async_generator

Async generators and context managers for Python 3.5+

async-generator v1.10 5.2M downloads/30d#2,137 on PyPI104
Permissive license MIT -or- Apache License 2.0 Abandoned released

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-generator

uv

uv add async-generator

poetry

poetry add async-generator

Installing 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

Development Status :: 5 - Production/StableFramework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

async generators python 3.5backport async yieldasynccontextmanager python 3.5async context manager decoratorpython 3.5 async support
async-backportlegacy-python

More Software Development packages