11# python-injection
22
33[ ![ CI] ( https://github.com/100nm/python-injection/actions/workflows/ci.yml/badge.svg )] ( https://github.com/100nm/python-injection )
4- [ ![ PyPI] ( https://img.shields.io/pypi/v/python-injection.svg?color=blue )] ( https://pypi.org/project/python-injection )
4+ [ ![ PyPI - Version] ( https://img.shields.io/pypi/v/python-injection.svg?color=blue )] ( https://pypi.org/project/python-injection )
5+ [ ![ PyPI - Downloads] ( https://img.shields.io/pypi/dm/python-injection.svg?color=blue )] ( https://pypistats.org/packages/python-injection )
56[ ![ Ruff] ( https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json )] ( https://github.com/astral-sh/ruff )
67
7- Fast and easy dependency injection framework.
8-
98## Installation
109
1110⚠️ _ Requires Python 3.12 or higher_
@@ -14,12 +13,22 @@ Fast and easy dependency injection framework.
1413pip install python-injection
1514```
1615
16+ ## Features
17+
18+ * Automatic dependency resolution based on type hints.
19+ * Support for multiple dependency lifetimes: ` transient ` , ` singleton ` , ` constant ` , and ` scoped ` .
20+ * Works seamlessly in both ` async ` and ` sync ` environments.
21+ * Separation of dependency sets using modules.
22+ * Runtime switching between different sets of dependencies.
23+ * Centralized setup logic using entrypoints.
24+ * Built-in type annotation for easy integration with [ ` FastAPI ` ] ( https://github.com/fastapi/fastapi ) .
25+ * Lazy dependency resolution for optimized performance.
26+
1727## Motivations
1828
19291 . Easy to use
20302 . No impact on class and function definitions
21- 3 . Easily interchangeable dependencies _ (depending on the runtime environment, for example)_
22- 4 . No prerequisites
31+ 3 . No tedious configuration
2332
2433## Quick start
2534
@@ -64,5 +73,6 @@ if __name__ == "__main__":
6473* [ ** Advanced usage** ] ( https://github.com/100nm/python-injection/tree/prod/documentation/advanced-usage.md )
6574* [ ** Loaders** ] ( https://github.com/100nm/python-injection/tree/prod/documentation/loaders.md )
6675* [ ** Entrypoint** ] ( https://github.com/100nm/python-injection/tree/prod/documentation/entrypoint.md )
67- * [ ** Integrations** ] ( https://github.com/100nm/python-injection/tree/prod/documentation/integrations.md )
76+ * [ ** Integrations** ] ( https://github.com/100nm/python-injection/tree/prod/documentation/integrations )
77+ * [ ** FastAPI** ] ( https://github.com/100nm/python-injection/tree/prod/documentation/integrations/fastapi.md )
6878* [ ** Concrete example** ] ( https://github.com/100nm/python-injection-example )
0 commit comments