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 | Provenance | Actions |
|---|---|---|---|---|
| depends_tools-1.1.0.tar.gz | 7.1 kB | Without provenance | Details for depends_tools-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| depends_tools-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for depends_tools-1.1.0-py3-none-any.whl |
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
|
Security for depends-tools 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.