Dependency injection framework for Python
-
Updated
Nov 1, 2025 - Python
Dependency injection (DI) is an implementation of the dependency inversion principle with the aim of separation of concerns by separating the depndency’s implementation from the class that’s using it. That kind of abstraction makes it possible to have different implementations with the same public methods so the class using it, doesn’t need to care which of the implementations is used. This is also especially useful for unit testing.
There are different types of dependency injection:
Dependency injection framework for Python
Python dependency injection framework, inspired by Guice
Cute dependency injection (DI) framework for Python with agreeable API and everything you need
FastDepends - FastAPI Dependency Injection system extracted from FastAPI and cleared of all HTTP logic. Async and sync modes are both supported.
Dependency injection container made for Python
A Flexible Service Locator for Python.
Practical Clean Architecture backend example built with FastAPI. No stateful globals (DI), low coupling (DIP), tactical DDD, CQRS, proper UoW usage. REST API, per-route error handling, session-based auth, contextual RBAC. Bundled with extensive docs and modern tooling
Fire up your models with the flame 🔥
Simple Dependency injection framework for Python
Implementation of dependency injection for Python 3
Performant, concise, and easy-to-use dependency injection container for Python 3.8+.
A Python implementation of Clean Architecture, inspired by Uncle Bob's book
A Clean Architecture Practice with Flask REST API
Python Dependency Injection for Humans™
provides a class-based View decorator to help reduce the amount of boilerplate necessary when developing related routes. ✨🚀
Real world Fast-API application template using gino(Async ORM) based on hexagonal architecture
A flexible command framework designed to extend the Hikari experience
Dependency injection for Python
Created by Martin Fowler
Released January 23, 2004