Metadata-Version: 2.1
Name: pypotage
Version: 2.0.0.1a0
Summary: A simple Python package that provides an easy way to use Dependency Injection in your projects.
Home-page: https://github.com/pavalso/potage
Author: Pavalso
License: MIT
Project-URL: Bug Tracker, https://github.com/pavalso/potage/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
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: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing_extensions==4.11.0
Requires-Dist: objproxies==0.9.4
Provides-Extra: dev
Requires-Dist: pytest==8.1.1; extra == "dev"
Requires-Dist: pytest-cov==5.0.0; extra == "dev"
Requires-Dist: Sphinx==7.3.7; extra == "dev"
Requires-Dist: sphinx_press_theme==0.9.1; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest==8.1.1; extra == "test"
Requires-Dist: pytest-cov==5.0.0; extra == "test"
Provides-Extra: doc
Requires-Dist: Sphinx==7.3.7; extra == "doc"
Requires-Dist: sphinx_press_theme==0.9.1; extra == "doc"

# pypotage

[![img](https://img.shields.io/pypi/v/pypotage.svg)](https://pypi.org/project/pypotage/)
[![img](https://img.shields.io/pypi/pyversions/pypotage.svg)](https://pypi.org/project/pypotage/)
![python-package-yml](https://github.com/pavalso/potage/actions/workflows/python-package.yml/badge.svg)
[![codecov](https://codecov.io/github/pavalso/potage/graph/badge.svg?token=GU0RXRS1E4)](https://codecov.io/github/pavalso/potage)

A simple Python package that provides an easy way to use Dependency Injection in your projects.

![alt text](https://imgur.com/7eK0mHJ.png)

## Key Features

- Easy to use
- Supports both function and class-based dependency 
injection
- Allows customizing the way dependencies are resolved
- Allows for the use of custom containers

## Installing

To install the latest **pypotage** version, run the following command:
````bash
python -m pip install -U pypotage
````

#### Development

To install the development version:
````bash
git clone https://github.com/pavalso/potage.git
cd potage
python -m pip install -U .
````

## Quick Examples

#### Basic usage
````python
import pypotage
import logging

@pypotage.prepare
def logger():
    logging.basicConfig(level=logging.DEBUG)
    return logging.getLogger(__name__)

pypotage.cook(logging.Logger).take_out().info("Hello World!")
````

#### Using classes
````python
import pypotage

class A:
    def __init__(self):
        ...

@pypotage.prepare
class B(A):
    def __init__(self):
        ...

pypotage.cook(A).take_out()  # returns an instance of B
````
