Skip to content


Python dependency injection you can taste.

A lightweight dependency injection and result processing framework for Python using type hints. Emphasis is on simplicity, ease of use, and minimal impact on source code.

import in_n_out as ino

# register functions that provide a dependency
def some_number() -> int:
    return 42

# inject dependencies into functions
def print_square(num: int):
    print(num ** 2)

print_square()  # prints 1764

See the Getting Started guide for a quick introduction or the API Reference for detailed documentation.


Install from pip

pip install in-n-out

Or from conda-forge

conda install -c conda-forge in-n-out