--- id: taskiq-dependencies version: "1.5.7" license: unclear license_treatment: unclear maintenance: aging --- # taskiq-dependencies — FastAPI like dependency injection implementation License: unclear · Maintenance: aging · Downloads: 1.8M/mo ## What it is and what it does Taskiq-dependencies is a standalone dependency injection library inspired by FastAPI's design. It builds a dependency graph from function signatures, validates for cycles at initialization, and resolves dependencies in the correct order. You define dependencies using the Depends() marker and call DependencyGraph to analyze a target function, then use sync_ctx() or async_ctx() to resolve and inject them. The library handles generator-based dependencies with setup/teardown semantics, supports async dependencies and async generators, allows runtime dependency replacement for testing, and can inject metadata about parameters via ParamInfo. It also supports generic type parameters for class-based dependencies. The package has no external dependencies beyond typing-extensions and works across Python 3.9–3.13. Use it for: - Add dependency injection to web frameworks or custom async applications without pulling in a full framework. - Manage database sessions, connection pools, or other resources with automatic setup and cleanup via generator dependencies. - Mock or replace dependencies in unit tests by passing replaced_deps to the context without modifying production code. - Build plugin systems or modular architectures where components declare their dependencies as function parameters. - Handle async initialization and teardown logic in async generators for service startup and resource cleanup. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides FastAPI-style dependency injection for Python projects, resolving dependency graphs and managing both synchronous and asynchronous dependency lifecycles. Yes, if you need lightweight dependency injection in a Python project and are comfortable with an aging but stable library. Low install friction and no external dependencies make it easy to adopt. Verify the license first, and be aware that maintenance is slow—suitable for stable use but not for projects requiring active upstream support. ## Install pip install taskiq-dependencies uv add taskiq-dependencies poetry add taskiq-dependencies ## Installing taskiq-dependencies Before you install: Low install friction with a single runtime dependency (typing-extensions). Maintenance status is aging—last release was 534 days ago—so expect slower response to issues, though the package remains stable for existing use. License in practice: License status is unclear; no SPDX identifier or raw license text is available in the metadata. Verify the actual license before using in proprietary or restricted contexts. Quickstart: pip install taskiq-dependencies from taskiq_dependencies import Depends, DependencyGraph def dep1() -> int: return 1 def target_func(some_int: int = Depends(dep1)): return some_int + 1 graph = DependencyGraph(target_func) with graph.sync_ctx() as ctx: result = target_func(**ctx.resolve_kwargs()) Verify before relying: - Whether the package is still actively maintained or in maintenance-only mode - What the actual license is (unclear in metadata) - Performance characteristics when resolving large or deeply nested dependency graphs ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 1.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags dependency injection framework, fastapi-like di system, async dependency resolution, dependency graph resolver, python di library, function parameter injection, dependency lifecycle management, dependency-injection, async-support, fastapi-inspired [View on SkillFed](https://skillfed.io/packages/taskiq-dependencies) · [View on PyPI](https://pypi.org/project/taskiq-dependencies/)