Skip to main content

Minimal Dependency Injection & Configuration Framework for Python

Project description

Skuf

PythonVersion

Minimal Dependency Injection & Configuration Framework for Python

🚀 Features

  • ⚡️ Lightweight and zero-dependency
  • 🧩 Simple Dependency Injection container
  • 🔐 Type-safe .env-based configuration loader (like pydantic.BaseSettings)
  • 🧱 Suitable for scripts, CLI tools, microservices

📦 Installation

pip install skuf

🧰 Dependency Injection

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!

⚙️ Environment Settings

# .env
API_KEY=supersecret
TIMEOUT=5
DEBUG=true
RETRIES=3
ADMINS=123|456

# settings.py
from skuf import BaseSettings
from typing import List

class Settings(BaseSettings):
    api_key: str
    timeout: int
    debug: bool
    retries: int
    admins: List[int]

settings = Settings()

print(settings.api_key)   # supersecret
print(settings.timeout)   # 5
print(settings.debug)     # True
print(settings.admins)    # [123, 456]

✅ Supports types:

  • str, int, float, bool
  • List[str], List[int], List[float] (via pipe-separated values like A|B|C)

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.2.1a0.tar.gz (4.9 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.2.1a0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file skuf-0.2.1a0.tar.gz.

File metadata

  • Download URL: skuf-0.2.1a0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0

File hashes

Hashes for skuf-0.2.1a0.tar.gz
Algorithm Hash digest
SHA256 53f0572d983c4a2af2ae9c9bc81243dd4e0b7b86296481db58eb4eb9bd8e2403
MD5 5f7870cde457e0e428d7b645f7e61763
BLAKE2b-256 461184ad5b3202a06f1d55109849a7833954493bf82ca568d76d4d8583326499

See more details on using hashes here.

File details

Details for the file skuf-0.2.1a0-py3-none-any.whl.

File metadata

  • Download URL: skuf-0.2.1a0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0

File hashes

Hashes for skuf-0.2.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddfc8c1d30dc41cf2f8ae622fed8f1dd4dd97593fff963d2a0ababa077fc62b8
MD5 f5b16515edcdc615755c7dfadb6d188b
BLAKE2b-256 ef5cb5c17762ca0d07a6d02662eaa45160f59d1eec06790baabf4cdeb388ab32

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