A simple dependency injector based on type hints
Project description
HinteDI - simple dependency injection system with type hints
This package is a small utility I have been using in my own projects, a super simple tool for basic dependency injection in python based on type hints and decorators.
This package exposes three classes: HinteDI, InjectionException and InstanceSentinel. Import HinteDI and use
@HinteDI.singleton and @HinteDI.instance to create dependencies and @HinteDI.inject to mark a
function as requiring dependency injection. Type hint the dependencies in the injected function and HinteDI will
inject the dependencies for you. You can also use @HinteDI.abstract_base, @HinteDI.singleton_implementation
and @HinteDI.instance_implementation to create factory-style abstract dependencies resolvable with a set key.
See the docs at GitHub pages for better documentation about the package.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file HinteDI-0.3.2.tar.gz.
File metadata
- Download URL: HinteDI-0.3.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c1371d3b7ffdf3e46ccf2488116e8e64cbc6d0d5abdd2c6b5d2941b8031eecd
|
|
| MD5 |
35ec2adb4050194bf9c16b1c2c667e7c
|
|
| BLAKE2b-256 |
66b8ec30d64283aa69cfa1ba20e1d498a11c381a0e3d18fa6f7b0aed5f5e0bbd
|
File details
Details for the file HinteDI-0.3.2-py3-none-any.whl.
File metadata
- Download URL: HinteDI-0.3.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
383849e5d90859a7fb49aaca71aa6c0170d1039d456cdb85113ae6a6b9eba31f
|
|
| MD5 |
70b618cd9a254b92d978f5ec128d1f1e
|
|
| BLAKE2b-256 |
772960401a3903fec7ea64c023e3155e87e7284a238432de997de613338272db
|