Skip to main content

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)

Source distribution for depends-tools 1.1.0
File Size Uploaded
depends_tools-1.1.0.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for depends-tools 1.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page