Skip to main content

A dependency injection framework for Python with dynamic late-binding resolution

Project description

hdmi

A lightweight dependency injection framework for Python 3.13+ with type-driven discovery and scope validation.

PyPI version Python versions CI Documentation License: MIT

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.

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

hdmi-0.2.3.tar.gz (107.0 kB view details)

Uploaded Source

Built Distribution

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

hdmi-0.2.3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file hdmi-0.2.3.tar.gz.

File metadata

  • Download URL: hdmi-0.2.3.tar.gz
  • Upload date:
  • Size: 107.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hdmi-0.2.3.tar.gz
Algorithm Hash digest
SHA256 e503643884d316e8ec62f623f1d8e4a6d9f1f37c6aa682e50c1a7b6930f1ead6
MD5 332e8ad921a7fbc0f81ed29a6132db4b
BLAKE2b-256 7fb1c3096ca9d9289e850d526358d2d4fdd1c5b7ed11906111fd4af67f2c30a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdmi-0.2.3.tar.gz:

Publisher: cicd.yml on msqd/hdmi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hdmi-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: hdmi-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hdmi-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4aa49fe60342c6f67f6761324bef34f2daf82376ca749beb6c6ed2143a7e549f
MD5 b62c3343ffd1f0d75a82444aa3954627
BLAKE2b-256 3ec89b86444001d6692ec5ab3d26f0565caa4b1625a0b47a1009b220dfe59a29

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdmi-0.2.3-py3-none-any.whl:

Publisher: cicd.yml on msqd/hdmi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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