backports.asyncio.runner
Backport of asyncio.Runner, a context manager that controls event loop life cycle.
Decision gist · record as of 2026-08-14
Yes, if you are on Python 3.8, 3.9, or 3.10 and need asyncio.Runner's context manager pattern. The package is stable (Production/Stable status), has no dependencies, and carries no known vulnerabilities. Maintenance is aging but the repository is not archived and recent commits confirm ongoing care. Only install if your target Python version is below 3.11; otherwise use the standard library.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8, 3.9, or 3.10; do not install on Python 3.11 or above (use the standard library instead).
- Consider adding a version marker like `python_version < '3.11'` to your dependency specification.
- Low install friction with no runtime dependencies.
License · maintenance · safety
PSF-2.0 (permissive) — Licensed under PSF-2.0 (Python Software Foundation License), a permissive license. No restrictions on use in commercial or proprietary projects.
last release 2025-07-02 (408 days) · last repo commit 2025-07-02 · 4 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 22,657,496 downloads/mo, #966 on PyPI
Alternatives
Verify before relying
import sys
if sys.version_info < (3, 11):
from backports.asyncio.runner import Runner
else:
from asyncio import Runner
async def echo(msg: str) -> None:
print(f"Hello {msg}")
with Runner() as runner:
runner.run(echo("World"))- Whether the slight performance degradation from using _PyTask instead of _CTask is acceptable for your use case.
- Compatibility with alternative event loop implementations beyond uvloop.
What it is and what it does
This package backports Python 3.11's asyncio.Runner to earlier Python versions (3.8, 3.9, 3.10). Runner is a context manager that simplifies the lifecycle management of an event loop when running multiple async functions, handling setup, teardown, and context variable propagation automatically. It provides full feature parity with the Python 3.11 standard library implementation, including contextvars.Context support, and is tested against the official CPython test suite.
The backport uses a custom Task implementation (_PyTask) rather than the C-accelerated version to support Runner's requirements, which introduces a small performance cost compared to Python 3.11+. It is compatible with alternative event loop factories like uvloop. The package is intended only for Python versions before 3.11; users on 3.11 or later should use the standard library directly.
Use it for
- Migrate async code from Python 3.11+ back to 3.8–3.10 without rewriting event loop management.
- Use asyncio.Runner's context manager pattern in legacy projects stuck on older Python versions.
- Ensure consistent async function execution behavior across Python 3.8–3.11 in multi-version codebases.
- Integrate with uvloop or other event loop factories while maintaining Runner's lifecycle management.
- Test async code that relies on contextvars propagation in Python 3.8–3.10 environments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are on Python 3.8, 3.9, or 3.10 and need asyncio.Runner's context manager pattern.
The package is stable (Production/Stable status), has no dependencies, and carries no known vulnerabilities. Maintenance is aging but the repository is not archived and recent commits confirm ongoing care. Only install if your target Python version is below 3.11; otherwise use the standard library.
Install
backports-asyncio-runner on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance shows aging status—last release was 408 days ago—but the repository remains active with a recent commit on 2025-07-02. Suitable for projects on older Python versions that need this specific backport.
Requires Python 3.8, 3.9, or 3.10; do not install on Python 3.11 or above (use the standard library instead). Consider adding a version marker like `python_version < '3.11'` to your dependency specification.
License in practice
Licensed under PSF-2.0 (Python Software Foundation License), a permissive license. No restrictions on use in commercial or proprietary projects.
Quickstart
import sys
if sys.version_info < (3, 11):
from backports.asyncio.runner import Runner
else:
from asyncio import Runner
async def echo(msg: str) -> None:
print(f"Hello {msg}")
with Runner() as runner:
runner.run(echo("World"))
Verify before relying
- Whether the slight performance degradation from using _PyTask instead of _CTask is acceptable for your use case.
- Compatibility with alternative event loop implementations beyond uvloop.
Package facts
| License | PSF-2.0 permissive |
| Python support | Capped below the current Python release <3.11,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 408 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 22,657,496 / month, #966 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: backports_asyncio_runner-1.2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “asyncio runner backport”
- backports.asyncio.runnerProvides the Python 3.11 asyncio.Runner context manager for Python…
- taskgroupBackports asyncio.TaskGroup, asyncio.Runner, and asyncio.timeout from…
- asyncioThis package is an obsolete backport of Python's asyncio module and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also taskgroup · asyncio · aiocontextvars · backports_abc · contextlib2 · nest-asyncio · uvloop · winloop · backports.tempfile · nest-asyncio2