Skip to main content

Lightweight dependency injection for Python 3.13+

Project description

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.

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.4.tar.gz (105.7 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.4-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hdmi-0.2.4.tar.gz
  • Upload date:
  • Size: 105.7 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.4.tar.gz
Algorithm Hash digest
SHA256 f8d80a5049b6cfa6f58a80eb99ad89c02a9f860326a8afe1eb28980976914036
MD5 b202c441a1cbfc3719a9b29650a31fa4
BLAKE2b-256 58e005e8529e7e2ff80d72bdf42f146f2b6492ecd9dd56eededd52061f78b49c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hdmi-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 65642e395b3f533eb49f4ac6cad18ff45f8f8d6d728c4dfb21ad302d411dbf1d
MD5 17fcfaf8627fc96e9e763f3c49812727
BLAKE2b-256 773835fc317abcc3e11c8c408188660bfe7b459cb45ed23027b8e93f7aa70cd8

See more details on using hashes here.

Provenance

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