Minimal Dependency Injection Container for Python
Project description
Skuf
Minimal Dependency Injection Container for Python
🚀 Features
- ✨ Lightweight and minimal
- ✅ Pythonic and explicit
- 🧱 Suitable for scripts, CLIs, and microservices
📦 Installation
pip install skuf
📝 Usage
from skuf import DIContainer, Dependency
# Define a Logger
class Logger:
def log(self, msg: str):
print(msg)
DIContainer.register(Logger) # Register the class
logger = DIContainer.resolve(Logger)
def test_func(logger = Dependency(Logger)):
logger.log("Hello, World! From a function!")
logger.log("Hello, World!")
test_func()
# Output:
# Hello, World!
# Hello, World! From a function!
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
skuf-0.1.1.tar.gz
(2.4 kB
view details)
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
skuf-0.1.1-py3-none-any.whl
(3.1 kB
view details)
File details
Details for the file skuf-0.1.1.tar.gz.
File metadata
- Download URL: skuf-0.1.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.12.8 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
063206cbb378f77da3a15e84ad91459b4b86df5719ebe4de8be7769ba7413ab8
|
|
| MD5 |
d57d35cbd5efe956d26fea70b16b220a
|
|
| BLAKE2b-256 |
00686308d297ac08fcbe09f9f4ca7e7300047ec2ed48add539f6b8ba409c058e
|
File details
Details for the file skuf-0.1.1-py3-none-any.whl.
File metadata
- Download URL: skuf-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.12.8 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21a8b30f44e79e36d5e2ea49051e78dab43353f541cc6d3127b9b30a9becdb17
|
|
| MD5 |
84da89337624da9ec0cf13a4b2145b05
|
|
| BLAKE2b-256 |
66e36d070fa5d18275b92269ba6f371ac95b216554618871df8cd5a0f3aa4381
|