Metadata-Version: 2.5
Name: pyiv
Version: 0.3.0
Summary: Guice-style dependency injection for Python, with scopes, qualified keys, and test doubles
Project-URL: Homepage, https://github.com/rl337/pyiv
Project-URL: Documentation, https://rl337.org/pyiv/
Project-URL: Repository, https://github.com/rl337/pyiv
Project-URL: Issues, https://github.com/rl337/pyiv/issues
Project-URL: Changelog, https://rl337.org/pyiv/changelog.html
Author-email: Richard Lee <rlee@tokyo3.com>
License: MIT
License-File: LICENSE
Keywords: dependency-injection,di,guice,injector,ioc
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.8
Provides-Extra: dev
Requires-Dist: bandit>=1.7.5; extra == 'dev'
Requires-Dist: black<25.0.0,>=23.0.0; extra == 'dev'
Requires-Dist: isort<6.0.0,>=5.12.0; extra == 'dev'
Requires-Dist: mypy<1.8.0,>=1.0.0; extra == 'dev'
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser<3,>=2.0.0; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == 'docs'
Requires-Dist: sphinx>=5.0.0; extra == 'docs'
Description-Content-Type: text/markdown

# pyiv

Guice-style dependency injection for Python: type-based constructor injection,
scopes, qualified keys, and built-in test doubles. Zero runtime dependencies.
Python 3.8+.

**Docs:** [https://rl337.org/pyiv/](https://rl337.org/pyiv/) ·
**Changelog:** [https://rl337.org/pyiv/changelog.html](https://rl337.org/pyiv/changelog.html) ·
**PyPI:** [https://pypi.org/project/pyiv/](https://pypi.org/project/pyiv/)

## Install

```bash
pip install pyiv
```

Requires Python 3.8 or newer. Unreleased `main`:

```bash
pip install git+https://github.com/rl337/pyiv.git
```

## Quick start

```python
from pyiv import Config, get_injector

class Database:
    pass

class PostgreSQL(Database):
    pass

class MyConfig(Config):
    def configure(self):
        self.register(Database, PostgreSQL)

injector = get_injector(MyConfig)
db = injector.inject(Database)  # PostgreSQL
```

The [user guide](https://rl337.org/pyiv/) covers Binder, Keys, scopes,
and the Clock / Filesystem / Console / DateTimeService test doubles.

## Development

```bash
pip install -e ".[dev,docs]"
./run_checks.sh
```

`run_checks.sh` formats (black/isort), runs pytest (including doctests in
`pyiv/`), mypy, bandit, and a Sphinx build.

Version numbers are bumped by GitHub Actions on `main`. Do not edit
`pyproject.toml` / `pyiv/__init__.py` versions except for a manual major bump
(the 0.3.0 PyPI release is that exception).

## License

MIT — see [LICENSE](LICENSE).
