--- id: wireup version: "2.12.0" license: MIT license_treatment: permissive maintenance: active --- # wireup — Python Dependency Injection Library License: permissive · Maintenance: active · Downloads: 99.4K/mo ## 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 above — 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 pip install wireup uv add wireup poetry add wireup ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 99.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dependency injection python, DI container, inversion of control, fastapi dependency injection, django dependency injection, type-driven wiring, service container, dependency-injection, inversion-of-control, async-support [View on SkillFed](https://skillfed.io/packages/wireup) · [View on PyPI](https://pypi.org/project/wireup/)