Skip to content

About

Automated dependency injection for Python

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Autoinject

Documentation Status

A clean, simple type-safe framework for using the Dependency Injection pattern in Python.

Example

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 for more details.

About

Automated dependency injection for Python

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages