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.1a0.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
File details
Details for the file skuf-0.1.1a0.tar.gz.
File metadata
- Download URL: skuf-0.1.1a0.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 |
9101127d9a2acc5bd23d3072f959f32957a07ac178a09b61d483849d156fbe05
|
|
| MD5 |
1f3411abae07597cfbcfc1296529f750
|
|
| BLAKE2b-256 |
d7e8ef61715dd83ac2094276e2b8e68f1e79ebdbbd8a0d6b4cbc4dece08b0dfc
|
File details
Details for the file skuf-0.1.1a0-py3-none-any.whl.
File metadata
- Download URL: skuf-0.1.1a0-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 |
aa109f989cd4fdcf4a9f65c0922aae931405bccde9df349fb6f8c477918388c9
|
|
| MD5 |
4063044dc1f01a80b4cbae7673c247ac
|
|
| BLAKE2b-256 |
ef0ff977c70c0fa860ce1a5474d80a19897bdde18be4bb6f6f0693ce3a10ad65
|