Metadata-Version: 2.4
Name: autoinject
Version: 2.0.0
Summary: Automated dependency injection for Python
Home-page: https://github.com/turnbullerin/autoinject
Author: Erin Turnbull
Author-email: erin.a.turnbull@gmail.com
Project-URL: Bug Tracker, https://github.com/turnbullerin/autoinject/issues
Project-URL: Documentation, https://autoinject.readthedocs.io/en/latest/
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Autoinject

[![Documentation Status](https://readthedocs.org/projects/autoinject/badge/?version=latest)](https://autoinject.readthedocs.io/en/latest/?badge=latest)

A clean, simple type-safe framework for using the [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) pattern in Python.

## Example

```python

from autoinject import injector, auto

@injector.injectable
class MyService:
    def __init__(self): ...
    

class MyClient:
  
  service: MyService
  
  @injector.construct
  def __init__(self):
    # self.service will be set before this function is called
    ...
  
@injector.inject
def my_client_function(service: MyService = auto()):
    # service will be set before this function is called
    ...

```
    
Read the [full documentation](https://autoinject.readthedocs.io/en/latest/?) for more details.
