Metadata-Version: 2.1
Name: picodi
Version: 0.2.0
Summary: Simple Dependency Injection for Python
Home-page: https://github.com/yakimka/picodi
License: MIT
Author: yakimka
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Repository, https://github.com/yakimka/picodi
Description-Content-Type: text/markdown

# picodi

[![Build Status](https://github.com/yakimka/picodi/actions/workflows/workflow-ci.yml/badge.svg?branch=main&event=push)](https://github.com/yakimka/picodi/actions/workflows/workflow-ci.yml)
[![Codecov](https://codecov.io/gh/yakimka/picodi/branch/main/graph/badge.svg)](https://codecov.io/gh/yakimka/picodi)
[![PyPI - Version](https://img.shields.io/pypi/v/picodi.svg)](https://pypi.org/project/picodi/)
![PyPI - Downloads](https://img.shields.io/pypi/dm/picodi)

Simple Dependency Injection for Python

Experimental dependency injection library for Python. Use it at your own risk.

## Installation

```bash
pip install picodi
```

## Example

```python
from picodi import inject, Provide


def get_redis() -> str:
    yield "redis"
    print("closing redis")


@inject
def get_storage_service(redis: str = Provide(get_redis)) -> str:
    return f"storage_service({redis})"


assert get_storage_service() == "storage_service(redis)"
```

## License

[MIT](https://github.com/yakimka/picodi/blob/main/LICENSE)


## Credits

This project was generated with [`yakimka/cookiecutter-pyproject`](https://github.com/yakimka/cookiecutter-pyproject).

