NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1301 most downloaded on PyPI
Dependency injection framework for Python
Last release 3 months ago
18 Jun 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
262 releases · first in 2016
Add singleton.full_reset() method to reset all underlying singleton providers.
Add singleton.full_reset() method to reset all underlying singleton providers.
Fix container.reset_singleton() to reset all provider types, not only Singleton.
Improve container.traverse(types=[...]) and provider.traverse(types=[...]) typing stubs to return types -typed iterator.
Update docs on creating custom providers with a requirement to specify .related property.
Add container.reset_singleton() method to reset container singletons.
Add container.reset_singleton() method to reset container singletons.
Refactor container.apply_container_providers_overridings() to use container.traverse(). This enables deep lazy initialization of Container providers.
Add tests for Selector provider.
Add tests for ProvidedInstance and MethodCaller providers.
Update Makefile to make Python 3 tests to be a default test command: make test.
One column per quarter.
Add FastAPI + SQLAlchemy example. Thanks to @ShvetsovYura _ for providing initial example: FastAPI_DI_SqlAlchemy _.
Add FastAPI + SQLAlchemy example. Thanks to @ShvetsovYura for providing initial example: FastAPI_DI_SqlAlchemy.
Add container base class containers.Container. DynamicContainer and DeclarativeContainer become subclasses of the Container. See issue: #386 _. Thanks
Add container base class containers.Container. DynamicContainer and DeclarativeContainer become subclasses of the Container. See issue: #386. Thanks to @ventaquil for reporting the issue.
Add Configuration.from_pydantic() method to load configuration from a pydantic settings.
Add Configuration.from_pydantic() method to load configuration from a pydantic settings.
Add container providers traversal.
Add container providers traversal.
Fix an issue with container.init_resource() and container.shutdown_resource() ignoring nested resources that are not present on the root level. See issue: #380. Thanks to @approxit for finding and reporting the issue.
Add .provides attribute to Singleton and its subclasses. It's a consistency change to make Singleton match Callable and Factory interfaces.
Add .initializer attribute to Resource provider.
Update string representation of Resource provider.
Fix PyCharm typing warning "Expected type 'Optional[Iterable[ModuleType]]', got 'List[module.py]' instead" in container.wire() method.
Fix PyCharm typing warning "Expected type 'Optional[Iterable[ModuleType]]', got 'List[module.py]' instead" in container.wire() method.
Fix declarative container metaclass bug: parent container providers replaced child container providers. See issue: #367 _. Many thanks to Shaun Cutts
Fix declarative container metaclass bug: parent container providers replaced child container providers. See issue: #367. Many thanks to Shaun Cutts for finding and report the issue.
Add default argument to the dependency provider: Dependency(..., default=...). See issue: #336 _. Many thanks to Shaun Cutts _ for providing the use c
Add default argument to the dependency provider: Dependency(..., default=...). See issue: #336. Many thanks to Shaun Cutts for providing the use case.
Add wiring import hook that auto-wires dynamically imported modules. See issue: #365 _. Thanks to @Balthus1989 _ for providing a use case.
Add wiring import hook that auto-wires dynamically imported modules. See issue: #365. Thanks to @Balthus1989 for providing a use case.
Replace weakrefs with normal refs in ConfigurationOption to support Container().provider() use case. Test that it does not introduce a memory leak. Se
Replace weakrefs with normal refs in ConfigurationOption to support Container().provider() use case. Test that it does not introduce a memory leak. See issue: #358#issuecomment-764482059. Many thanks to @Minitour for reporting the issue.
Fix a bug in providers.Container when it's declared not at class root level. See issue #379 _. Many thanks to @approxit _ for reporting the issue.
Fix a bug in @containers.copy to improve replacing of subcontainer providers. See issue #378 _. Many thanks to Shaun Cutts _ for reporting the issue.
Fix a bug in @containers.copy to improve replacing of subcontainer providers. See issue #378. Many thanks to Shaun Cutts for reporting the issue.
Add loader argument to the configuration provider Configuration.from_yaml(..., loader=...) to override the default YAML loader. Many thanks to Stefano
Add loader argument to the configuration provider Configuration.from_yaml(..., loader=...) to override the default YAML loader. Many thanks to Stefano Frazzetto for suggesting an improvement.
Make security improvement: change default YAML loader to the custom yaml.SafeLoader with a support of environment variables interpolation. Many thanks to Stefano Frazzetto for suggesting an improvement.
Update configuration provider .from_*() methods to raise an exception in strict mode if configuration file does not exist or configuration data is undefined. Many thanks to Stefano Frazzetto for suggesting an improvement.
Add required argument to the configuration provider .from_*() methods to specify mandatory configuration sources. Many thanks to Stefano Frazzetto for suggesting an improvement.
Fix a bug with asynchronous injections: async providers do not work with async dependencies. See issue: #368. Thanks @kolypto for the bug report.
Refactor asynchronous injections.
Add extra tests for asynchronous injections.
Migrate CI to Github Actions.
Fix a bug in the Configuration provider: strict mode didn't work when provider is overridden by None. See issue: #358#issuecomment-761607432 _. Many t
Fix a bug in the Configuration provider: strict mode didn't work when provider is overridden by None. See issue: #358#issuecomment-761607432. Many thanks to Stefano Frazzetto for reporting the issue.
Fix a bug in Resource that cause failure when async resource depends on another async resource. See issue #361 _. Thanks @kolypto _ for the bug report
Fix a Python 3.9 specific bug in wiring module: introspection doesn't work for builtin types.GenericAlias. This resulted in wiring failure for modules
Fix a Python 3.9 specific bug in wiring module: introspection doesn't work for builtin types.GenericAlias. This resulted in wiring failure for modules importing queue.Queue. See issue #362. Thanks @ventaquil for the bug report.
Switch Coveralls reporting Travis Job to run on Python 3.9.
Add strict mode and required modifier for Configuration provider. See issue #341 _. Thanks ms-lolo _ for the feature request.
Fix a bug in the Configuration provider to correctly handle undefined values. See issue #358 _. Many thanks to Stefano Frazzetto _ for reporting the i
Fix a bug in the Configuration provider to correctly handle undefined values. See issue #358. Many thanks to Stefano Frazzetto for reporting the issue.
Add .dependencies attribute to the DeclarativeContainer and DynamicContainer. It returns dictionary of container Dependency and DependenciesContainer
Add .dependencies attribute to the DeclarativeContainer and DynamicContainer. It returns dictionary of container Dependency and DependenciesContainer providers. See issue #357. Many thanks to Shaun Cutts for suggesting the feature.
Fix a bug in the Configuration provider to correctly handle overriding by None. See issue #358 _. Many thanks to Stefano Frazzetto _ for reporting the
Fix a bug in the Configuration provider to correctly handle overriding by None. See issue #358. Many thanks to Stefano Frazzetto for reporting the issue.
Fix Container provider to apply context overridings on root container initialization. See issue #354 _. Many thanks to Shaun Cutts _ for submitting th
Fix Container provider to apply context overridings on root container initialization. See issue #354. Many thanks to Shaun Cutts for submitting the issue.
Hotfix for version 4.8.0: fix side effect in Container provider overriding.
Fix declarative container multi-level inheritance issue. See issue #350 _. Many thanks to Shaun Cutts _ for submitting the issue.
Fix declarative container multi-level inheritance issue. See issue #350. Many thanks to Shaun Cutts for submitting the issue.
Add support of overriding Container provider. See issue #354 _. Many thanks to Shaun Cutts _ for submitting the issue.
Add support of overriding Container provider. See issue #354. Many thanks to Shaun Cutts for submitting the issue.
Add container injection support for wiring.
Add container injection support for wiring.
Add Disqus comments widget to the provider's async injections docs page.
Add Disqus comments widget to the provider's async injections docs page.
Fix a typo in ext.flask deprecation warning. See PR #345 _ for details. Thanks to Fotis Koutoupas _ for the fix.
Add support of async injections for providers.
Add support of async injections for wiring.
Add support of async initializers for Resource provider.
Add FastAPI + Redis example.
Add ARM wheel builds. See issue #342 for details.
Fix a typo in ext.flask deprecation warning. See PR #345 for details. Thanks to Fotis Koutoupas for the fix.
Update copyright year.
Fix manylinux wheels uploading issue. See issue #333 _ for details. Thanks to Richard Jones _ for reporting the issue.
Fix manylinux wheels uploading issue. See issue #333 for details. Thanks to Richard Jones for reporting the issue.
Fix 4.5.2 degradation bug in wiring @inject with not working FastAPI.Depends directive. See issue #331 _ for details. Thanks to Juan Esteban Marín _ f
Fix 4.5.2 degradation bug in wiring @inject with not working FastAPI.Depends directive. See issue #331 for details. Thanks to Juan Esteban Marín for reporting the issue.
Add FastAPI tests.
Fix a bug in wiring @inject with not properly working FastAPI.Depends directive. See issue #330 _ for details. Thanks to Lojka-oops _ for reporting th
Fix a bug in wiring @inject with not properly working FastAPI.Depends directive. See issue #330 for details. Thanks to Lojka-oops for reporting the issue.
Fix flake8 issue in Commands and Handlers example.
Fix flake8 issue in Commands and Handlers example.
Add support of non-string keys for Dict provider.
Add support of non-string keys for Dict provider.
Add simple FastAPI example.
Add Commands and Handlers example from issue #327.
Add extra typing test for provided instance of DependenciesContainer provider.
Improve FastAPI integration: handle Depends(Provide[...]).
Improve FastAPI integration: handle Depends(Provide[...]).
Update FastAPI example.
Remove a typo from the Flask tutorial.
Add @inject decorator. It helps to fix a number of wiring bugs and make wiring be more resilient.
Add @inject decorator. It helps to fix a number of wiring bugs and make wiring be more resilient.
Refactor wiring module.
Update documentation and examples to use @inject decorator.
Add Flask blueprints example.
Fix wiring bug when wiring doesn't work with the class-based decorators.
Fix wiring bug when wiring doesn't work with the decorators that doesn't use functools.wraps(...).
Fix wiring bug with @app.route(...) -style decorators (Flask, Sanic, FastAPI, etc.).
Fix wiring bug when wiring doesn't work with Flask blueprints.
- Add FastAPI example.
Add FastAPI example.
Add a hotfix to support wiring for FastAPI endpoints.
Add a hotfix to support wiring for FastAPI endpoints.
Fix race in ThreadSafeSingleton. Many thanks to Dmitry Rassoshenko aka rda-dev _ for the pull request (See PR #322 _).
Fix race in ThreadSafeSingleton. Many thanks to Dmitry Rassoshenko aka rda-dev for the pull request (See PR #322).
- Fix changelog typo.
Fix changelog typo.
Fix a bug in wiring module that caused multiple imports of the modules when .wire(packages=[...]) is used (See issue #320 _). Thanks to Federico iskor
Fix a bug in wiring module that caused multiple imports of the modules when .wire(packages=[...]) is used (See issue #320). Thanks to Federico iskorini for reporting the issue.
Fix a bug in Configuration provider that resulted in not working .reset_override() (See issue #319 _). Thanks to Jun lust4life _ for reporting the iss
Fix a bug in Configuration provider that resulted in not working .reset_override() (See issue #319). Thanks to Jun lust4life for reporting the issue and suggesting a fix.
Fix a bug in wiring with improper patching of @classmethod and @staticmethod decorated methods (See issue #318 _).
Fix a bug in wiring with improper patching of @classmethod and @staticmethod decorated methods (See issue #318).
Fix a bug in wiring with mistakenly initialized and shutdown resource with Closing marker on context argument providing.
Fix a bug in wiring with mistakenly initialized and shutdown resource with Closing marker on context argument providing.
- Fix README.
Fix README.
Implement per-function execution scope for Resource provider in tandem with wiring.Closing.
Implement per-function execution scope for Resource provider in tandem with wiring.Closing.
- Add support of Python 3.9. - Update readme.
Add support of Python 3.9.
Update readme.
Update asyncio daemon, single- and multi-container examples to use Resource provider.
Update asyncio daemon, single- and multi-container examples to use Resource provider.
Add CI job to build and push documentation to S3 bucket.
Add CI job to build and push documentation to S3 bucket.
Fix wiring of multiple containers (see issue #313 _). Thanks to iskorini _ for reporting the issue.
Fix Travis CI windows and MacOS builds.
Fix Travis CI windows and MacOS builds.
Fix version of cibuildwheel==1.63.
Fix version of cibuildwheel==1.63.
Update Travis CI webhooks to fix builds triggering.
Bump version of cibuildwheel>=1.5.1 to resolve Windows build problem.
Bump version of cibuildwheel>=1.5.1 to resolve Windows build problem.
Fix a few typos in Resource provider docs.
Fix a few typos in Resource provider docs.
"Un-deprecate" @containers.override() and @containers.copy() decorators ( see Issue 301 _ for more information).
Add Resource provider.
Add Dict provider.
"Un-deprecate" @containers.override() and @containers.copy() decorators ( see Issue 301 for more information).
Add favicon.
Remove redirects that occur while getting badge images to optimize docs load speed.
Update license year.
Update short description on PyPI.
Fix wiring for top-level package __init__.py.
Fix wiring for top-level package __init__.py.
Move .provided attribute to providers.Provider.
Move .provided attribute to providers.Provider.
Update all links in documentation and examples to use https:// instead of http.
Fix typing stubs for container.override() method.
Fix typing stubs for container.override() method.
Deprecate @containers.override() and @containers.copy() decorators.
Deprecate @containers.override() and @containers.copy() decorators.
Update changelog of version 4.0.0 so it lists all deprecated features.
Fix typing stubs for @container.override() and @containers.copy() decorators ( see PR 302 _). Thanks to JarnoRFB _ for reporting the issue.
Extend Configuration.from_ini() and Configuration.from_yaml() typing stubs to accept pathlib.Path. The methods were already compatible with pathlib.Pa
Deprecate ext.aiohttp module in favor of wiring feature.
New features:
Add wiring feature.
Deprecations:
Deprecate ext.aiohttp module in favor of wiring feature.
Deprecate ext.flask module in favor of wiring feature.
Deprecate .delegate() provider method in favor of .provider attribute.
Removals:
Remove deprecated types module.
Tutorials:
Update flask tutorial.
Update aiohttp tutorial.
Update asyncio daemon tutorial.
Update CLI application tutorial.
Examples:
Add django example.
Add sanic example.
Update aiohttp example.
Update flask example.
Update asyncio daemon example.
Update movie-lister example.
Update CLI application example.
Misc:
Regenerate C sources using Cython 0.29.21.
Improve documentation and README (typos removal, rewording, etc).
Your coding agent can read these notes before it upgrades. Set up the MCP server →