Skip to content

orsinium-labs/dependency_injectors

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Libraries

List of dependency injection libraries for Python, sorted by stars:

Tests

dependencies antidote diay dependency_injector
Easy to use ✔️ ✔️ ✔️
Good docs ✔️ ✔️
Explicit container ✔️ ✔️
Type annotation ✔️ ✔️
Lazy annotation ✔️ ✔️
Name detection ✔️
Function as target ✔️ ✔️ ✔️
Partial injection ✔️ ✔️ ✔️ ✔️
Overload deps ✔️ ✔️ ✔️
Deps for deps ✔️ ✔️ ✔️ ✔️

Test description:

  • Easy to use -- you don't have to know about some difficult conceptions and write much of code.
  • Good docs -- documentation exists and contains many examples and API reference.
  • Explicit container -- you define set of dependencies explicitly that helps you to find out which dependencies was used here without debugging.
  • Type annotation -- library can detect right dependency by type in annotations.
  • Lazy annotation -- library can work with lazy type annotations (defined as string). In Python 4.0 all annotations will be lazy.
  • Name detection -- library can detect right dependency by variable name.
  • Function as target -- you can inject dependencies into function.
  • Partial injection -- you can mix up dependencies with not injected arguments.
  • Overload deps -- you can pass your own dependencies to override dependencies in container.
  • Deps for deps -- dependencies can be injected into other dependencies.

Usage

See tests dir and docs for libraries for usage examples.

Run tests

pip3 install --user -r requirements.txt
pytest --tb=short

Not tested yet

About

Tests and comparison of Python dependency injection libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages