python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

Dependency injection framework for Python

Results 239 python-dependency-injector issues
Sort by recently updated
recently updated
newest added
trafficstars

This code works pretty well: ```python class Settings(BaseSettings): ... class Container(containers.DeclarativeContainer): config = providers.Singleton(Settings) ... ``` I used pydantic settings, but I think this example can be used for any...

Problem description ================= Currently, string imports are not possible outside of packages. Minimal reproducible example ========================= The following code snippet executed from a script or Jupyter notebook cell raises an...

Addresses https://github.com/ets-labs/python-dependency-injector/issues/731

I encountered a strange behaviour of Configuration depending on which source the Configuration object took data from during its initialisation. This leads to a radically different interface of this class...

question

Starlette recently added cool new feature called [lifespan](https://www.starlette.io/lifespan/) in [v0.26.0](https://github.com/encode/starlette/releases/tag/0.26.0) and FastAPI [followed the suit](https://fastapi.tiangolo.com/advanced/events/#lifespan) in [v0.93.0](https://github.com/tiangolo/fastapi/releases/tag/0.93.0). This makes it possible to get rid of good chunk of initialization spaghetti...

``` from typing import List from dependency_injector import containers from dependency_injector.wiring import inject # MyList = List[int] MyList = list[int] class Container(containers.DeclarativeContainer): pass @inject def main(): pass if __name__ ==...

I am currently trying to achieve something with the dependency injection. I am not aware if this is already possible, but if it is, feel free to just point me...

is it possible to let IDE recognise the config parameter? for example, when we register this `application.config.aws.access_key_id.from_env("AWS_ACCESS_KEY_ID")` we inject config to one service in the service, if want to use...

we are using the Dependency injector in Scrapy and deploy the egg to scrapyd (by scrapy-client) the egg already include the yaml config, but base on our test, the yaml...

Hello! Thanks for your library! That is something that i am using in each web app that i created. I really like how things work with this lib but have...