wireup
Python Dependency Injection Library
What it is and what it does
Wireup is a dependency injection container that uses Python type annotations to automatically resolve and wire dependencies at container startup. It supports multiple lifetimes (singleton, scoped, transient), async/await, resource cleanup via generators, configuration injection, and collection injection. The container validates the entire dependency graph on startup—if it starts successfully, your wiring is correct—avoiding runtime surprises. It integrates natively with FastAPI, Django, Flask, Starlette, Celery, Click, and Typer, and works equally well in standalone scripts, CLI tools, and background workers.
The library is designed for reuse: you write your application code once and inject the same dependencies into APIs, CLIs, workers, and scripts without rewriting wiring logic. It emphasizes fail-fast validation, thread-safety, and PEP 703 (no-GIL) readiness. Dependencies are registered via the @injectable decorator on classes, functions, generators, or dataclasses; the decorator's behavior adapts to the function signature (e.g., a generator becomes a resource with cleanup, an async function becomes an async dependency).
Use it for:
- FastAPI applications: inject database, service, and config dependencies into route handlers without per-request overhead
- Django projects: centralize service and repository wiring for views, middleware, and management commands
- CLI tools (Click, Typer): inject config and services into command handlers with automatic lifecycle management
- Background workers (Celery): share the same dependency graph across task definitions and ensure cleanup on task completion
- Microservices: define dependencies once and reuse the container across multiple entry points (API, worker, scheduler)
- Testing: override dependencies with context managers to isolate tests and restore the original graph automatically
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Wireup is a type-driven dependency injection container for Python that resolves and manages application dependencies at startup, supporting singletons, scoped, and transient lifetimes across sync and async code.
Yes. Wireup is production-ready (Development Status 5), actively maintained, has no known vulnerabilities, and low install friction. It solves a real problem—centralizing dependency management across multiple entry points—with a clean API and fail-fast validation. Use it if you're building multi-entry-point applications (APIs, CLIs, workers) or want to avoid manual wiring boilerplate in frameworks like FastAPI or Django.
Install
wireup on PyPI
pip
pip install wireupuv
uv add wireuppoetry
poetry add wireupInstalling wireup
Before you install
Low install friction with a single lightweight runtime dependency (typing-extensions). Active maintenance with recent releases; last commit 2026-07-09 and 427 repository stars indicate ongoing development.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions; you may use, modify, and distribute freely provided you include the license notice.
Quickstart
pip install wireup
import wireup
from wireup import Injected, injectable
@injectable
class Database:
pass
container = wireup.create_sync_container(injectables=[Database])
# Inject via Injected[Database] in FastAPI routes or other entry points
Requires Python 3.10 or later; async features require an async runtime (asyncio, etc.)
Verify before relying
- Actual performance characteristics in dense dependency graphs compared to manual wiring or other containers
- Thread-safety and no-GIL readiness claims require testing in your specific use case
- Full scope of framework integrations beyond FastAPI, Django, Flask, Starlette, Celery, Click, Typer
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 36 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 99,426/month — #13,022 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: wireup-2.12.0-py3-none-any.whl
Keywords: dependency injection, dependency injection container, dependency injector, django, flask, injector
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
dependency-injectorDependency Injector is a dependency injection…
permissive · top 5,000 on PyPI
rodiRodi is a dependency injection container for…
permissive · top 15,000 on PyPI
picoboxPicobox is a lightweight dependency injection…
permissive · top 15,000 on PyPI
lagomLagom is a lightweight dependency injection…
permissive · top 15,000 on PyPI
dishkadishka is an IoC container that manages…
permissive · top 15,000 on PyPI
slackA dependency injection container that registers…
permissive · top 15,000 on PyPI
kinkKink is a lightweight dependency injection…
permissive · top 15,000 on PyPI
injectorInjector is a Python dependency injection…
permissive · top 5,000 on PyPI
svcssvcs is a dependency container that registers…
permissive · top 5,000 on PyPI
simple-diA strictly typed dependency injection library…
permissive · top 15,000 on PyPI