{"id":63765,"url":"https://github.com/sfermigier/awesome-dependency-injection-in-python","name":"awesome-dependency-injection-in-python","description":"A curated list of awesome things related to dependency inversion / dependency injection in Python. (Contributions welcomed).","projects_count":48,"last_synced_at":"2026-07-10T04:00:24.061Z","repository":{"id":45543501,"uuid":"205809958","full_name":"sfermigier/awesome-dependency-injection-in-python","owner":"sfermigier","description":"A curated list of awesome things related to dependency inversion / dependency injection in Python. (Contributions welcomed).","archived":false,"fork":false,"pushed_at":"2026-03-26T18:41:40.000Z","size":75,"stargazers_count":483,"open_issues_count":8,"forks_count":27,"subscribers_count":10,"default_branch":"main","last_synced_at":"2026-06-22T03:04:36.253Z","etag":null,"topics":["awesome","awesome-lists","dependency-injection","python"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sfermigier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-02T08:21:17.000Z","updated_at":"2026-06-12T18:06:40.000Z","dependencies_parsed_at":"2023-11-23T04:40:35.002Z","dependency_job_id":"c8aa4843-f408-43aa-88dd-b5ac9ef1ee49","html_url":"https://github.com/sfermigier/awesome-dependency-injection-in-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sfermigier/awesome-dependency-injection-in-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfermigier%2Fawesome-dependency-injection-in-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfermigier%2Fawesome-dependency-injection-in-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfermigier%2Fawesome-dependency-injection-in-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfermigier%2Fawesome-dependency-injection-in-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sfermigier","download_url":"https://codeload.github.com/sfermigier/awesome-dependency-injection-in-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfermigier%2Fawesome-dependency-injection-in-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35319810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"created_at":"2024-07-21T00:00:25.580Z","updated_at":"2026-07-10T04:00:24.062Z","primary_language":"Python","list_of_lists":false,"displayable":true,"categories":["Articles / blog posts","Software","Talks / slides","Videos","Books"],"sub_categories":["DI Frameworks / Containers","DI components of Web frameworks","Archived or unmaintained DI frameworks","Integration with web frameworks"],"readme":"# Awesome Dependency Injection in Python\n\n\u003e A curated list of awesome things related to dependency inversion / dependency injection in Python.\n\n[![Awesome](https://awesome.re/badge.svg)](https://awesome.re)\n\n\n## Talks / slides\n\n- **Python Dependency Injection** [(PDF)](http://www.aleax.it/yt_pydi.pdf) (Alex Martelli, 2008).\n- Fang: Pythonic dependency injection [(video)](https://www.youtube.com/watch?v=zqRd941NXlI\u0026t=443s) (Nathan Craike, 2015).\n\n## Videos\n\n- [Loose Coupling \u0026 Dependency Injection the EASY Way!](https://www.youtube.com/watch?v=uWTvMCra-_Y) (Hynek Schlawack, 2024)\n- [Dependency Inversion: Write BETTER PYTHON CODE Part 2](https://www.youtube.com/watch?v=Kv5jhbSkqLE) (ArjanCodes, 2021)\n- [Dependency INVERSION vs Dependency INJECTION in Python](https://www.youtube.com/watch?v=2ejbLVkCndI) (ArjanCodes, 2021)\n\n\n## Articles / blog posts\n\n- [Enforcing Single Responsibility Principle in Python](https://sobolevn.me/2019/03/enforcing-srp) (Nikita Sobolev / Никита Соболев, 2019)\n- [Pythonic Dependency Injection: A Practical Guide](https://medium.com/@suneandreasdybrodebel/pythonic-dependency-injection-a-practical-guide-83a1b1299280) (Sune Andreas Dybro Debel, 2018)\n- [Elegant Flask API Development Part 1](https://christophergs.github.io/python/2018/09/25/elegant-flask-apis-pt-1/) (mostly covers Flask-Injector).\n- [\"(pytest) Fixtures: a prime example of dependency injection\"](https://docs.pytest.org/en/latest/fixture.html#fixtures-a-prime-example-of-dependency-injection)\n- [Tests and comparison of Python dependency injection libraries](https://github.com/orsinium/dependency_injectors) ★3 - Tests and comparison of Python dependency injection libraries. [🐍, Unknown license].\n- [Typed Functional Dependency Injection in Python](https://sobolevn.me/2020/02/typed-functional-dependency-injection)\n- [DI patterns](https://lab.abilian.com/Tech/Architecture%20%26%20Design/Dependency%20Inversion/DI%20patterns/) (Abilian, 2024)\n- [DI anti-patterns](https://lab.abilian.com/Tech/Architecture%20%26%20Design/Dependency%20Inversion/DI%20anti-patterns/) (Abilian, 2024)\n\n\n## Books\n\n- [Pythonic Application Architecture Patterns for Managing Complexity](https://github.com/python-leap/book) ★3737 - A Book about Pythonic Application Architecture Patterns for Managing Complexity.  Cosmos is the Opposite of Chaos you see. O'R. wouldn't actually let us call it \"Cosmic Python\" tho. [🐍, Other license].\n\n\n## Software\n\n### DI Frameworks / Containers\n\n- [python-dependency-injector](https://github.com/ets-labs/python-dependency-injector) ★4833 - Dependency injection framework for Python. [🐍, BSD 3-Clause \"New\" or \"Revised\" License].\n- [returns](https://github.com/dry-python/returns) ★4244 - Make your functions return something meaningful, typed, and safe!. [🐍, BSD 2-Clause \"Simplified\" License].\n- [Injector](https://github.com/alecthomas/injector) ★1513 - Python dependency injection framework, inspired by Guice. [🐍, BSD 3-Clause \"New\" or \"Revised\" License].\n- [Dishka](https://github.com/reagento/dishka) ★1109 - Cute DI framework with agreeable API and everything you need. [🐍, Apache License 2.0].\n- [Inject](https://github.com/ivankorobkov/python-inject) ★770 - Python dependency injection. [🐍, Apache License 2.0].\n- [FastDepends](https://github.com/lancetnik/FastDepends) ★497 - FastAPI Dependency Injection system extracted from FastAPI and cleared of all HTTP logic. [🐍, MIT License].\n- [Kink](https://github.com/kodemore/kink) ★438 - Dependency injection container made for Python. [🐍, MIT License].\n- [Punq](https://github.com/bobthemighty/punq) ★418 - An IoC container for Python 3.6+. [🐍, MIT License].\n- [svcs](https://github.com/hynek/svcs) ★403 - A Flexible Service Locator for Python. [🐍, MIT License].\n- [Wireup](https://github.com/maldoinc/wireup) ★373 - Concise, Powerful, and Type-Safe Python Dependency Injection Library. [🐍, MIT License].\n- [di](https://github.com/adriangb/di) ★335 - Pythonic dependency injection. [🐍, MIT License].\n- [Lagom](https://lagom-di.readthedocs.io/en/latest/) ★246: Type based auto-wiring dependency injection with support for async and threading. [🐍, MIT License].\n- [That Depends](https://github.com/modern-python/that-depends) ★244 - simple DI-framework, inspired by python-dependency-injector, but without wiring [🐍, MIT License].\n- [Rodi](https://github.com/RobertoPrevato/rodi) ★234 - Implementation of dependency injection for Python 3. [🐍, MIT License].\n- [diwire](https://github.com/maksimzayats/diwire) ★217 - Type-safe dependency injection for Python with auto-wiring, scopes, async factories, and zero deps [🐍, MIT License].\n- [python-injection](https://github.com/100nm/python-injection) ★126 - Dead-simple dependency injection framework for Python. [🐍, MIT License].\n- [injectable](https://github.com/allrod5/injectable) ★118 - Python Dependency Injection for Humans™. [🐍, MIT License].\n- [Opyoid](https://github.com/illuin-tech/opyoid) ★76 - Dependency injection library for Python. [🐍, MIT License].\n- [Modern DI](https://github.com/modern-python/modern-di) ★50 - powerful DI-framework with scopes and IoC-container [🐍, MIT License].\n- [Picodi](https://github.com/yakimka/picodi) ★31 - A DI library inspired by FastAPI. It integrates well with FastAPI but can also be used independently. [🐍, MIT License].\n- [andi](https://github.com/scrapinghub/andi) ★24 - Library for annotation-based dependency injection. [🐍, BSD 3-Clause \"New\" or \"Revised\" License].\n- [Fresh Bakery](https://github.com/Mityuha/fresh-bakery) ★21 - Bake dependency injections asynchronously and stupidly simple. [🐍, MIT License].\n- [engin](https://github.com/invokermain/engin) ★20 - a dependency injection powered application framework, inspired by [Uber's fx framework](https://github.com/uber-go/fx). [🐍, MIT License].\n- [ididi](https://github.com/raceychan/ididi) ★19  - Genius simplicity, unmathced power, dependency injection in a single line of code. [🐍, MIT License]\n- [injection](https://github.com/nightblure/injection) ★18 - replacement for [python-dependency-injector](https://github.com/ets-labs/python-dependency-injector) that works with Python 3.8-3.12 and works with FastAPI, DRF, Flask and Litestar [🐍, MIT License].\n- [Injex](https://github.com/vshulcz/injex) ★14 - Tiny typed dependency injection container with constructor injection, singleton/transient/scoped lifetimes, test overrides, and graph validation before startup. Zero runtime dependencies. [🐍, MIT License].\n- [Clean IoC](https://github.com/peter-daly/clean_ioc) ★10 - A simple unintrusive dependency injection library for python with strong support for generics [🐍, MIT License].\n- [Overlay](https://github.com/Atry/MIXINv2) ★6 - A dependency injection framework with pytest-fixture syntax, plus a configuration language for declarative programming [🐍, MIT License].\n\n### DI components of Web frameworks\n\nSeveral modern Python web frameworks include DI components, including:\n\n- FastAPI -\u003e [Dependencies - First Steps](https://fastapi.tiangolo.com/tutorial/dependencies/).\n- Litestar -\u003e [Dependency Injection](https://docs.litestar.dev/2/usage/dependency-injection.html).\n- Sanic -\u003e [Dependency Injection](https://sanic.dev/en/plugins/sanic-ext/injection.html).\n- Xpresso -\u003e [di](https://github.com/adriangb/di) (see above)\n- Blacksheep -\u003e [Rodi](https://github.com/RobertoPrevato/rodi) (see above)\n\n\n### Integration with web frameworks\n\n- [Flask-Injector](https://github.com/alecthomas/flask_injector) ★283 - Adds Injector support to Flask. [🐍, BSD 3-Clause \"New\" or \"Revised\" License].\n\nSee also above.\n","projects_url":"https://awesome.ecosyste.ms/api/v1/lists/sfermigier%2Fawesome-dependency-injection-in-python/projects"}