skillfed

wireup

Python Dependency Injection Library

wireup v2.12.0 99.4K downloads/30d#13,022 on PyPI427
Permissive license MIT Active released

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 wireup

uv

uv add wireup

poetry

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 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentFramework :: DjangoFramework :: FastAPIFramework :: FlaskFramework :: aiohttpIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

dependency injection pythonDI containerinversion of controlfastapi dependency injectiondjango dependency injectiontype-driven wiringservice container
dependency-injectioninversion-of-controlasync-support

More Python Modules packages