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.2.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.2-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hdmi-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 34e125e597c17316703d0fa69b18d35a2c42bc50aeb3decdcba32fb236ba1887
MD5 239109264a2d4f46adc4a841f7d0049b
BLAKE2b-256 e1b48b94691a012940f0348cad6e7b19218ff8ddd8e9c5ad794bf2d5e5d1e092

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdmi-0.2.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: hdmi-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 322cd644c54da3416d057d20454329a67664ff1cc18362c028ecd4fb7b7037b6
MD5 1283b64cc77921be14f8feb998ab5462
BLAKE2b-256 959681485f1c510cd65b3a84e82fac9baa529881173cbd6c3e2fa80ee8d8ae96

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdmi-0.2.2-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