vshulcz/injex
71.7
Strong · 9 November 2026
4k
lines of production code
Python
primary language
7
measurements over time
What this system is
Injex is a Python dependency injection library that manages object lifecycles and resolves dependencies through a container. It provides core features like scoped and transient object management, automatic registration, and graph validation. The system includes optional integrations for major web frameworks (FastAPI, Django, Flask, etc.) and CLI tools, supported by a comprehensive test suite and benchmarking suite for performance comparison.
Features
Added benchmark suite for dependency injection performance
Added a new \benchmarks/\ directory containing Python scripts and documentation to measure and compare the performance of various Python dependency injection libraries. The suite includes \resolve\_graph.py\ for synchronous resolution, \resolve\_async.py\ for async resolution patterns, and \resolve\_scoped.py\ for per-request scope overhead. The \README.md\ provides instructions for running the benchmarks and presents the latest local results, allowing users to see how Injex and other libraries perform on a typical service-layer graph.
benchmarks · high confidence
Introduce Injex, a Python dependency injection container
Injex is a new dependency injection library for Python, providing a \Container\ for managing object lifecycles (singleton, scoped, transient) and resolving dependencies. The package exposes core classes like \Container\, \Scope\, and \AsyncScope\, along with decorators such as \@injectable\ for automatic registration and \@inject\ for property injection. It supports named dependencies via \Annotated\ types, context data injection, and validation of the dependency graph. The library also includes a CLI tool (\python -m injex check\) for validating container graphs in CI environments, and a testing helper (\overrides\) for temporarily swapping bindings during tests.
injex · high confidence
New framework integrations and CLI injection support
Added optional integrations for FastAPI, aiohttp, Django, Flask, Litestar, Quart, Sanic, and Starlette, each providing thin glue code to open an Injex scope per request and expose it on the request object. Added CLI injection support via the \injex.ext.cli\ module, which provides an \Inject()\ marker and a \wire()\ decorator to inject services into command-line functions. Added a \tasks\ module (\injex.ext.tasks\) with \inject\ and \ainject\ decorators for injecting services into background tasks and handlers across frameworks like Celery, Arq, and aiogram.
injex/ext · high confidence
Behavioural changes
Expanded example suite for Injex
The examples directory now includes a broader set of usage patterns, including clean architecture, CLI injection, configuration injection, cyclic dependency validation, factory-based scoped resources, and FastAPI integration (both standard and async). These examples demonstrate how to wire dependencies, manage resource lifecycles, and integrate Injex with external frameworks.
examples · high confidence
Site refresh: new landing page, article, and SEO infrastructure
The site now features a redesigned landing page (index.html) with updated positioning, performance benchmarks, and use-case descriptions. A new article (why-tiny-python-di.html) explains the rationale for a tiny DI container. A 404 page has been added. SEO and discoverability are improved with a robots.txt, sitemap.xml, and an llms.txt/llms-full.txt context file for AI indexing. The site's visual style is updated via a new styles.css.
site · high confidence
Test coverage
Added tests for async resolution, framework integrations, and CLI injection
Added tests for async resolution, framework integrations, and CLI injection. The new test files cover the async resolution path (including async factories, scoped resources, and lifecycle invariants), the \container.call()\/\acall()\ function injection, CLI injection via \@wire\, and framework integrations for aiohttp, Django, FastAPI, Flask, Litestar, Sanic, and Quart. Additional tests validate error messages, context data, concurrency safety, and edge cases like default values and property injection.
tests · high confidence
Dependencies
Initial project configuration and dependency manifest
The project is now configured for Python packaging and development using pyproject.toml, establishing version 1.9.0 for the 'injex' package. The configuration defines build requirements (setuptools), Python version compatibility (3.10+), and optional dependencies for various web frameworks including FastAPI, Django, Starlette, Litestar, Flask, AIOHTTP, Quart, and Sanic. Development tooling is also specified, including mypy, pytest, ruff, and click, alongside CI and code quality tooling settings.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 70 → 72 (+1.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 80 → 80 (+0.0)
- Architecture 100 → 99 (-1.4)
- Maturity 70 → 75 (+4.8)
- Readiness 61 → 61 (+0.0)
- Security 81 → 85 (+3.5)
- Performance 100 → 100 (+0.0)
Resolved (5)
- Conflicting overload signatures. Same issue as resolve. The type | str overload shadows the more specific type[T] overload, breaking type inference for users who pass a type hint.
- Conflicting overload signatures. The class defines three overloads for resolve, but the third overload interface: type | str is a superset of the first two. In Python typing, this makes the first two overloads unreachable or ambiguous for type checkers, as the third one will always match. It also creates inconsistency between type[T] (returning T) and type | str (returning Any), which is confusing for users expecting type safety.
- Inconsistent naming and purpose for injection markers. cli.Inject is a function returning Any (likely a marker), tasks.inject is a decorator factory taking a container, and planning.inject is a decorator taking a function. The name inject is used for different mechanisms (decorator vs marker) across modules, and Inject (capitalized) is used in CLI. This is confusing for users trying to understand how to inject dependencies in different contexts.
- Redundant factory registration methods. Similar to the instance registration issue, register_factory takes a lifestyle string, while the specific add_*_factory methods hardcode it. This duplicates intent and API surface.
- Redundant registration methods. register accepts a lifestyle string argument, while add_singleton, add_transient, and add_scoped hardcode the lifestyle. This creates two ways to achieve the same result (e.g., register(..., 'singleton') vs add_singleton(...)), leading to API confusion and potential inconsistency if the string values don't match the enum/constant definitions.
New (1)
- Low vulnerability: [GHSA redacted] (uv.lock)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
vshulcz/injex was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit ba01497d00b233dc97e134791c9246e8139df65d — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-bb0cb800cd0f.