--- id: taskgroup version: "0.2.2" license: unclear license_treatment: permissive maintenance: active --- # taskgroup — backport of asyncio.TaskGroup, asyncio.Runner and asyncio.timeout License: permissive · Maintenance: active · Downloads: 2.8M/mo ## What it is and what it does TaskGroup is a backport of Python 3.12.8's structured concurrency primitives to older Python versions. It provides TaskGroup (for managing groups of concurrent tasks with unified exception handling), Runner (a context manager for running async code), and timeout (for enforcing time limits on async operations). The implementation works by temporarily replacing the current asyncio.Task with a subclass that adds uncancel and context-setting support, allowing most of asyncio's C-accelerated behavior to remain intact. This package is useful when you want to write modern async code using Python 3.12's concurrency patterns but need to support older Python environments. It depends on exceptiongroup and typing_extensions to bridge compatibility gaps. Use it for: - Write async code using TaskGroup syntax on older Python versions without waiting for a platform upgrade. - Manage multiple concurrent tasks with automatic exception aggregation and cleanup across Python versions. - Add timeout enforcement to async operations on Python versions that lack native asyncio.timeout. - Migrate legacy async codebases to structured concurrency patterns while maintaining backward compatibility. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Backports asyncio.TaskGroup, asyncio.Runner, and asyncio.timeout from Python 3.12.8 to Python 3.8–3.11, enabling structured concurrency patterns on older Python versions. Yes, if you need TaskGroup or timeout on Python versions prior to 3.12. The package is lightweight, permissively licensed, actively maintained, has no known vulnerabilities, and solves a real compatibility gap. Use conditional imports to avoid redundancy on Python 3.12+. ## Install pip install taskgroup uv add taskgroup poetry add taskgroup ## Installing taskgroup Before you install: Low install friction; pure Python wheel with only two lightweight runtime dependencies (exceptiongroup and typing_extensions). Repository is active with a recent release (2025-01-03) and no archived status. License in practice: MIT license (permissive); you can use this in commercial and proprietary projects with minimal restrictions, provided you include the license notice. Quickstart: from taskgroup import TaskGroup, timeout, run async def main(): async with TaskGroup() as group: group.create_task(some_coroutine()) run(main()) Requires Python 3.8 or later; asyncio event loop must be available. Verify before relying: - Whether the backport maintains full API and behavior parity with Python 3.12.8 TaskGroup in edge cases. - Performance characteristics compared to native asyncio.TaskGroup in Python 3.12+. - Whether uncancel and context-setting behavior is fully compatible with all asyncio patterns. - Exact Python version support range (description mentions 3.8–3.11 but requires_python is unspecified). ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 2.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio taskgroup backport, structured concurrency python, asyncio runner timeout, python 3.8 taskgroup, async task management, asyncio context manager, concurrent task groups, asyncio, backport, concurrency [View on SkillFed](https://skillfed.io/packages/taskgroup) · [View on PyPI](https://pypi.org/project/taskgroup/)