Dependency Injection library
Project description
PyxDI (in development)
PyxDI
is a modern, lightweight and async-friendly Python Dependency Injection library that leverages type annotations (PEP 484)
to effortlessly manage dependencies in your applications.
Documentation
Requirements
Python 3.7+
and requires anyio
Installation
Install using pip
:
pip install pyxdi
or using poetry
:
poetry add pyxdi
Quick Example
app.py
import pyxdi
di = pyxdi.PyxDI()
@di.provider
def message() -> str:
return "Hello, world!"
@di.inject
def say_hello(message: str = pyxdi.dep) -> None:
print(message)
if __name__ == "__main__":
say_hello()
TODO
- Documentation (in progress)
- Examples (in progress)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyxdi-0.4.0a1.tar.gz
(9.9 kB
view hashes)
Built Distribution
pyxdi-0.4.0a1-py3-none-any.whl
(10.0 kB
view hashes)