$npx skillfedfor your agent

aiocontextvars

Asyncio support for PEP-567 contextvars backport.

SkipPyPI Software DevelopmentReleased Apr 2019446.2K downloads / moBSD licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — aiocontextvars-0.2.2-py2.py3-none-any.whl
v0.2.2 · released 2019-04-08 · Python >=3.5 · 1 runtime deps: contextvars

No, unless you are maintaining legacy code on Python 3.5 or 3.6 that requires contextvars asyncio support. The package is abandoned (last release 2019, last commit 2022) and unnecessary on Python 3.7+. Modern Python versions have built-in contextvars with full asyncio support; use the standard library instead.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • On Python 3.5 and 3.6, must import aiocontextvars before creating event loops or tasks; custom event loop implementations (e.g., uvloop.new_event_loop) will not be patched and won't behave correctly.
  • Low install friction with a single pure-Python dependency.
  • However, the package is abandoned—last release was in 2019 and last commit in 2022.

License · maintenance · safety

BSD license (permissive) — BSD license is permissive and imposes no significant restrictions on use or redistribution.

last release 2019-04-08 (2685 days) · last repo commit 2022-12-26 · 56 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 446,231 downloads/mo, #6,613 on PyPI

Verify before relying

pip install aiocontextvars

import aiocontextvars
import asyncio
from contextvars import ContextVar

var = ContextVar('var')
var.set('value')

async def main():
    print(var.get())

asyncio.run(main())
  • Whether the package still works reliably with modern asyncio implementations given its age and abandonment status.
  • Whether the contextvars asyncio backport issue mentioned in the description has since been resolved in the upstream contextvars package.
Same gist for agents: .md · .json

What it is and what it does

aiocontextvars patches the contextvars backport library to add asyncio support for Python 3.5 and 3.6, allowing context variables to be properly inherited and maintained across async task boundaries. On Python 3.7+, it is simply a pass-through to the built-in contextvars module, which already has full asyncio integration.

The package works by monkey-patching asyncio's event loop and task creation to attach and propagate copied contexts. It requires importing the module before creating any event loops or tasks to ensure the patches are applied. On older Python versions, it provides a workaround for the lack of native context parameter support in call_soon() and Task creation, though the implementation differs from Python 3.7's native approach.

Use it for

  • Maintaining request-scoped context (e.g., user ID, request ID) across async task chains on Python 3.5–3.6.
  • Migrating legacy asyncio code from Python 3.5–3.6 that relies on context variable inheritance to Python 3.7+.
  • Ensuring context isolation between concurrent tasks in older Python versions before native contextvars asyncio support existed.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Skip

No, unless you are maintaining legacy code on Python 3.5 or 3.6 that requires contextvars asyncio support.

The package is abandoned (last release 2019, last commit 2022) and unnecessary on Python 3.7+. Modern Python versions have built-in contextvars with full asyncio support; use the standard library instead.

Install

aiocontextvars on PyPI

Before you install

Low install friction with a single pure-Python dependency. However, the package is abandoned—last release was in 2019 and last commit in 2022. On Python 3.7+, it is purely a delegate to the built-in contextvars module, making it unnecessary for modern codebases.

On Python 3.5 and 3.6, must import aiocontextvars before creating event loops or tasks; custom event loop implementations (e.g., uvloop.new_event_loop) will not be patched and won't behave correctly.

License in practice

BSD license is permissive and imposes no significant restrictions on use or redistribution.

Quickstart

pip install aiocontextvars

import aiocontextvars
import asyncio
from contextvars import ContextVar

var = ContextVar('var')
var.set('value')

async def main():
    print(var.get())

asyncio.run(main())

Verify before relying

  • Whether the package still works reliably with modern asyncio implementations given its age and abandonment status.
  • Whether the contextvars asyncio backport issue mentioned in the description has since been resolved in the upstream contextvars package.

Package facts

LicenseBSD license permissive
Python supportSupports the current Python release >=3.5
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
contextvars
MaintenanceAbandoned 2,685 days since the last release
Last repo commit
First released
Downloads446,231 / month, #6,613 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6

Evidence: aiocontextvars-0.2.2-py2.py3-none-any.whl

Tags

Capabilities
contextvars asyncio supportcontext variables async tasksasyncio context propagationPEP-567 backport asynciotask-local context storageasync context inheritance
Topics
async-contextlegacy-python
PyPI keywords
aiocontextvars

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 › “contextvars asyncio support”

  • aiocontextvarsProvides asyncio support for the contextvars backport library on…
  • opencensus-contextProvides in-process context propagation for OpenCensus, automatically…
  • types-contextvarsProvides type stubs for Python's contextvars module, enabling static…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also contextvars · types-contextvars · opencensus-context · backports.asyncio.runner · asyncio · taskgroup · nest-asyncio · aiomcache · nest-asyncio2 · backports_abc