You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

skuf

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skuf

Minimal Dependency Injection & Configuration Framework for Python

0.2.1
pipPyPI
Maintainers
1

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)

Keywords

di

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts