Dependence Injection library
Project description
Pyxdi (in dev)
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, inspired by the functionality of pytest fixtures.
Documentation
Installing
Install using pip
:
pip install pyxdi
or using poetry
:
poetry add pyxdi
Quick Example
app.py
import pyxdi
pyxdi.init()
@pyxdi.provider
def message() -> str:
return "Hello, world!"
@pyxdi.inject
def say_hello(message: str = pyxdi.dep) -> None:
print(message)
if __name__ == "__main__":
say_hello()
TODO
- Unit tests
- Autowiring
- Documentation
- Examples
- Pypi package
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.1.0a0.tar.gz
(9.0 kB
view hashes)
Built Distribution
pyxdi-0.1.0a0-py3-none-any.whl
(10.2 kB
view hashes)