[Go to site: main page, start]

Python Dependency Injection

Open-source Python projects categorized as Dependency Injection

Top 23 Python Dependency Injection Projects

Dependency Injection
  1. Dependency Injector

    Dependency injection framework for Python

    Project mention: Dependency Injection: a Python Way | dev.to | 2025-12-18

    Dependency Injector - Official Documentation

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. injector

    Python dependency injection framework, inspired by Guice

  4. fastapi-clean-example

    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

    Project mention: Contextual error handling for FastAPI — per-route, with OpenAPI schema generation | dev.to | 2025-08-13

    P.S. See it powering clean architecture example app: 👉 https://github.com/ivan-borovets/fastapi-clean-example

  5. FastDepends

    FastDepends - FastAPI Dependency Injection system extracted from FastAPI and cleared of all HTTP logic. Async and sync modes are both supported.

  6. kink

    Dependency injection container made for Python

  7. lagom

    📦 Autowiring dependency injection container for python 3 (by meadsteve)

  8. flama

    Fire up your models with the flame 🔥

    Project mention: Serving any LLM using a single command line with Flama | dev.to | 2026-06-16

    If you find Flama useful for building robust Machine Learning and Generative AI APIs, we'd be thrilled if you showed your support by giving us a ⭐ on GitHub. Your stars are the best fuel for our development efforts!

  9. flask_injector

    Adds Injector support to Flask.

  10. fastapi-class

    provides a class-based View decorator to help reduce the amount of boilerplate necessary when developing related routes. ✨🚀

  11. Tanjun

    A flexible command framework designed to extend the Hikari experience

  12. eff

    Python library to work with algebraic effects (by orsinium-labs)

  13. Bevy

    A dependency injection framework for Python! Bevy's primary goal is to help you write amazing code with less effort. (by ZechCodes)

  14. magic-di

    Dependency Injector with minimal boilerplate code, built-in support for FastAPI and Celery, and seamless integration to basically anything.

  15. pytest-fastapi-deps

    This library allows you to easily replace FastAPI dependencies in your tests. Regular mocking techniques do not work due to the inner working of FastAPI.

  16. engin

    A lightweight Application Framework for Python powered by Dependency Injection

    Project mention: Show HN: Engin – a modular application framework for Python | news.ycombinator.com | 2025-10-09
  17. fastapi-agent-blueprint

    FastAPI backend blueprint for AI agent apps: DDD, SQLAlchemy, Taskiq, admin UI, RAG infra, and Claude/Codex collaboration harness.

    Project mention: I got mass of CRUD in my FastAPI project, so I fixed it | dev.to | 2026-03-28

    I open-sourced it here if anyone wants to take a look: github.com/Mr-DooSun/fastapi-blueprint

  18. mitsuki

    Python's flexibility and productivity, Spring Boot's battle-tested enterprise patterns.

    Project mention: Show HN: Mitsuki, a Python web framework as fast as Node or Java | news.ycombinator.com | 2025-11-30
  19. dioxide

    Opinionated, Zero-ceremony, Rust-backed dependency injection for Python

    Project mention: dioxide v1.1.2: Multi-Binding for Plugin Systems | dev.to | 2026-01-20

    Changelog: CHANGELOG.md

  20. deadsimple

    A dependency injection library for python, aimed for the least amount of magic.

  21. aiohttp-deps

    Dependency injection for AioHTTP

  22. apywire

    Lazy object wiring and dependency injection for Python 3.12+

    Project mention: Apywire: Lazy object wiring and dependency injection for Python 3.12 | news.ycombinator.com | 2025-12-15

    This reminds me of _The Billion-Dollar Fix: Safe Modular Circular Initialisation with Placeholders and Placeholder Types_ https://dl.acm.org/doi/abs/10.1007/978-3-642-39038-8_9 https://ecs.wgtn.ac.nz/foswiki/pub/Main/TechnicalReportSerie...

    Apywire reports it can't handle circular dependency: https://github.com/alganet/apywire/blob/1c9a39df36a9385d8b34...

  23. python-rest-template

    A clean, scalable, i18n ready FastAPI template

  24. diay.py

    Dependency injection library for Python.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Python Dependency Injection discussion

Log in or Post with

Python Dependency Injection related posts

  • Serving any LLM using a single command line with Flama

    2 projects | dev.to | 16 Jun 2026
  • Fast dependency injection in Python without a provider framework

    2 projects | dev.to | 9 Jun 2026
  • dioxide v1.1.2: Multi-Binding for Plugin Systems

    2 projects | dev.to | 20 Jan 2026
  • Dependency Injection: a Python Way

    2 projects | dev.to | 18 Dec 2025
  • Apywire: Lazy object wiring and dependency injection for Python 3.12

    2 projects | news.ycombinator.com | 15 Dec 2025
  • Show HN: Mitsuki, a Python web framework as fast as Node or Java

    1 project | news.ycombinator.com | 30 Nov 2025
  • Guide to Path Variables and Query Parameters in Mitsuki Controllers

    1 project | dev.to | 29 Nov 2025
  • A note from our sponsor - SaaSHub
    www.saashub.com | 22 Jun 2026
    SaaSHub helps you find the best software and product alternatives Learn more →

Index

What are some of the best open-source Dependency Injection projects in Python? This list will help you:

# Project Stars
1 Dependency Injector 4,882
2 injector 1,530
3 fastapi-clean-example 563
4 FastDepends 510
5 kink 441
6 lagom 350
7 flama 286
8 flask_injector 283
9 fastapi-class 119
10 Tanjun 90
11 eff 80
12 Bevy 71
13 magic-di 70
14 pytest-fastapi-deps 34
15 engin 20
16 fastapi-agent-blueprint 21
17 mitsuki 20
18 dioxide 16
19 deadsimple 12
20 aiohttp-deps 11
21 apywire 5
22 python-rest-template 3
23 diay.py 3

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com

Did you know that Python is
the 1st most popular programming language
based on number of references?