New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hdmi

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hdmi

Lightweight dependency injection for Python 3.13+

pipPyPI
Version
0.2.4
Maintainers
1

hdmi

Lightweight dependency injection for Python 3.13+

PyPI version Python versions CI Documentation License

Warning: Pre-Alpha Software

hdmi is experimental software in active development. Breaking changes may occur until version 1.0.

Documentation: Full Docs | Getting Started | API Reference

Features

  • Type-driven dependency discovery — Uses Python's standard type annotations, no decorators needed
  • Scope-aware validation — Prevents lifetime bugs at container build time
  • Lazy instantiation — Services created just-in-time when first resolved
  • Two-phase architecture — Configuration separated from runtime for immutable, validated graphs

Quick Start

pip install hdmi
import asyncio
from hdmi import ContainerBuilder

class DatabaseConnection:
    def __init__(self):
        self.connected = True

class UserRepository:
    def __init__(self, db: DatabaseConnection):
        self.db = db

class UserService:
    def __init__(self, repo: UserRepository):
        self.repo = repo

async def main():
    builder = ContainerBuilder()
    builder.register(DatabaseConnection)
    builder.register(UserRepository)
    builder.register(UserService)

    container = builder.build()  # Validates the dependency graph
    user_service = await container.get(UserService)  # Auto-wired!

asyncio.run(main())

For scoped services (per-request lifecycles), transient services, and scope validation rules, see the documentation.

Development

This project follows strict TDD methodology. See CONTRIBUTING.md for details.

make test    # Run all tests
make docs    # Build documentation
make help    # Show all available commands

License

MIT License — see LICENSE for details.

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