Skip to main content

Minimal Dependency Injection Container for Python

Project description

Skuf

PythonVersion

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


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.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skuf-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file skuf-0.1.0.tar.gz.

File metadata

  • Download URL: skuf-0.1.0.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

Hashes for skuf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8ccc6d15ce4e92ac7267fbad510455e6cc276dfbc9e1da882396e8a1c09dd02c
MD5 6c05c098416e4f7b54517f96df22b5fb
BLAKE2b-256 9dc3415d06696885f5f31a9ae63a41ed0743bad6c99526a58c1c188d3831ab8d

See more details on using hashes here.

File details

Details for the file skuf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: skuf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 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

Hashes for skuf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 990d6a3181c2985d899c6f1b2c5ec43fb5c46db81a270a8a5921cc6d8abde9c1
MD5 a1511684b6dac26091f1fbdb59610433
BLAKE2b-256 0115dee0b053683679ac2125044ea0fde1d666044a88e8b313a34a597a816922

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page