py-depends
A lightweight and elegant Python dependency injection framework.
Features
- 🚀 Simple and intuitive API
- 🔄 Support for both sync and async dependencies
- 🏭 Factory pattern support
- 🎯 Type-safe dependency resolution
- 📦 Zero external dependencies
- 🧪 Comprehensive test coverage
Installation
pip install depends-tools
Quick Start
from depends_tools import Depends, inject
# Define a dependency
def get_database():
return "database_connection"
# Use the dependency
@inject
def get_user(db=Depends(get_database)):
return f"User from {db}"
# Resolve dependencies
result = get_user()
print(result) # Output: User from database_connection
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions, please open an issue on GitHub.
Metadata
Release files for depends-tools 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| depends_tools-1.1.0.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| depends_tools-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / depends_tools-1.1.0.tar.gz
| Download URL | depends_tools-1.1.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11facfac35276654d852e5bb0171715db03abbc51d6a823794439c0f24549a45
|
|
BLAKE2b-256 checksum How to use checksums |
f5157842d3da14a189b83e0d0016b2e66ec2918b10022d696025422365e1f54c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / depends_tools-1.1.0-py3-none-any.whl
| Download URL | depends_tools-1.1.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d41bb2c77ddf5808edd37480ab298aea6014dbdcb2e38fb3463c93b5303d725a
|
|
BLAKE2b-256 checksum How to use checksums |
c0a364285b9539be870453ec3b1850f0ed57c305e065c6954f1baabaf90782ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|