Metadata-Version: 2.4
Name: hdmi
Version: 0.2.2
Summary: A dependency injection framework for Python with dynamic late-binding resolution
Project-URL: Homepage, https://github.com/msqd/hdmi
Project-URL: Documentation, https://hdmi.readthedocs.io/
Project-URL: Repository, https://github.com/msqd/hdmi
Project-URL: Issues, https://github.com/msqd/hdmi/issues
Project-URL: Changelog, https://github.com/msqd/hdmi/blob/main/CHANGELOG.md
Author-email: Romain Dorgueil <romain@makersquad.fr>
License: MIT License
        
        Copyright (c) 2025 Romain Dorgueil
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.13
Requires-Dist: anyio>=4.0.0
Provides-Extra: dev
Requires-Dist: basedpyright>=1.21.0; extra == 'dev'
Requires-Dist: furo>=2024.0.0; extra == 'dev'
Requires-Dist: hatch>=1.16.2; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Requires-Dist: sphinx-autobuild>=2024.0.0; extra == 'dev'
Requires-Dist: sphinx>=8.0.0; extra == 'dev'
Requires-Dist: sphinxcontrib-mermaid>=1.0.0; extra == 'dev'
Requires-Dist: twine>=6.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# hdmi

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

[![PyPI version](https://img.shields.io/pypi/v/hdmi.svg)](https://pypi.python.org/pypi/hdmi)
[![Python versions](https://img.shields.io/pypi/pyversions/hdmi.svg)](https://pypi.python.org/pypi/hdmi)
[![CI](https://github.com/msqd/hdmi/actions/workflows/cicd.yml/badge.svg)](https://github.com/msqd/hdmi/actions/workflows/cicd.yml)
[![Documentation](https://readthedocs.org/projects/hdmi/badge/?version=latest)](https://hdmi.readthedocs.io/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

> **Warning: Pre-Alpha Software**
>
> hdmi is experimental software in active development. Breaking changes may occur until version 1.0.

**Documentation:** [Full Docs](https://hdmi.readthedocs.io/) | [Getting Started](https://hdmi.readthedocs.io/en/latest/tutorials/) | [API Reference](https://hdmi.readthedocs.io/en/latest/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

```bash
pip install hdmi
```

```python
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](https://hdmi.readthedocs.io/).

## Development

This project follows strict TDD methodology. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

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

## License

MIT License — see [LICENSE](LICENSE) for details.
