mikelane/dioxide
83.0
Strong · 21 September 2026
21k
lines of production code
Python
primary language
4
measurements over time
What this system is
Features
Add Celery integration example with scoped dependency injection
Added a new example in the \examples/celery\ directory that demonstrates how to use the dioxide library for dependency injection with Celery background tasks. The example implements a hexagonal architecture pattern, providing task-scoped containers, profile-based configuration (development vs. test), and lifecycle management for background jobs. It includes domain services, adapters (fakes for testing, logging for development), and tests verifying task isolation and execution.
examples/celery · high confidence
Add Click CLI example with dioxide integration
Added a new example in the \examples/click\ directory demonstrating how to build a production-ready CLI application using the \dioxide\ library for dependency injection with a hexagonal architecture. The example includes domain services, port definitions, and profile-based adapters (fakes for testing, logging for development) that integrate with the \click\ library using the \with\_scope\ decorator for per-command scoping. The package also includes a comprehensive test suite using \pytest\ and \CliRunner\ to verify command behavior with fake adapters.
examples/click · high confidence
Add FastAPI example with hexagonal architecture and constructor dependency injection
Added a comprehensive FastAPI example demonstrating hexagonal architecture with the dioxide library. The example showcases constructor dependency injection, where adapters like PostgresAdapter and SendGridAdapter receive their configuration via injected ConfigPort instances rather than reading environment variables directly. It includes profile-specific adapters for production, development, and testing, along with realistic fake implementations for fast, deterministic unit tests.
examples/fastapi · high confidence
Add Flask example with hexagonal architecture and request-scoped DI
A new Flask example demonstrates a production-ready application structure using dioxide for dependency injection and hexagonal architecture. It includes domain services, port definitions, and profile-based adapters (fakes for testing, logging for development). The example highlights request-scoped components, where each HTTP request gets a fresh instance of specific services, managed via Flask's g object. Tests use in-memory fakes to verify behavior without external dependencies.
examples/flask · high confidence
Add before-state examples for dependency-injector and injector migrations
Added example applications demonstrating the 'before' state for migrating away from the \dependency-injector\ and \injector\ libraries. The \from-dependency-injector/before\ directory contains a Python app using \dependency-injector\'s \containers\ and \providers\ for explicit dependency wiring, including adapters for PostgreSQL, Redis, and SendGrid. The \from-injector/before\ directory provides a similar example using the \injector\ library's \Module\ and \@inject\ patterns for an order management system. These serve as reference implementations for users looking to refactor their code.
examples/migrations/from-dependency-injector/before, examples/migrations/from-injector/before · high confidence
Add narrated demo videos for decorator usage, migration experience, and mock-to-fake patterns
The demos directory now includes a complete infrastructure for hosting narrated terminal recordings as a GitHub Pages site. This includes a README.md outlining the recording pipeline (using tools like asciinema, agg, and ffmpeg), a template HTML page (demo.html) for individual demos, and a main index.html for the gallery. Specific demo sets have been added: a 'decorator-usage' demo showing how to separate business logic from infrastructure; a 'migration-tool' demo illustrating the upgrade path from rivet\_di v1 to dioxide v2; and a 'mock-to-fake' demo contrasting mock-based and fake-based testing strategies. Each demo includes its own index.html, shell scripts for timing, and narration scripts.
demos · high confidence
Add project configuration and documentation scaffolding files
The repository now includes several new configuration and documentation files that support the project's build, testing, and documentation workflows. A \.gitattributes\ file is added to manage line endings and binary file handling, while \.python-version\ pins the development Python version to 3.14. A \.readthedocs.yaml\ file is introduced to configure automated documentation builds on Read the Docs, specifying Sphinx configuration, build tools, and versioning strategies. Additionally, a \codecov.yml\ file is added to configure Codecov coverage thresholds and reporting behavior. These files establish the infrastructure for consistent development, automated documentation generation, and code coverage tracking.
(repo-wide) · high confidence
Added comprehensive examples and documentation for hexagonal architecture patterns
The examples directory now includes a new README.md that serves as a central index for working code samples. It documents the directory structure, including a 'getting\_started\_example.py' for quick starts, 'hexagonal\_architecture.py' for full hexagonal pattern demos, and subdirectories for real-world patterns (dependency chains, circular dependency fixes, caching, external APIs) and migration guides from 'dependency-injector' and 'injector'. The README also explains how to run the examples using 'uv sync' and 'maturin develop', and details key concepts like profile-based injection and testing with fakes.
examples · high confidence
Added honest benchmark comparison suite for dioxide vs dependency-injector
A new benchmarking suite has been added to the project to provide an honest, unbiased performance comparison between the dioxide and dependency-injector frameworks. The suite, located in the \benchmarks/\ directory, includes a README explaining the methodology and a Python test file (\compare\_di\_frameworks.py\) that measures resolution times, deep dependency chains, concurrent resolution, container startup, and memory usage. This allows users to evaluate the performance characteristics of dioxide against a popular alternative using standardized, statistically rigorous tests.
benchmarks · high confidence
Added migration examples and caching/circular-dependency pattern examples
Added example code demonstrating how to migrate from dependency-injector and injector to dioxide, showing the use of @adapter.for\_() and @service decorators with profile-based registration. Also added examples for the caching adapter pattern (decorator/wrapper pattern with Redis cache and test fakes) and circular dependency detection, providing concrete code samples for each scenario.
(repo-wide) · high confidence
Enhanced scan reporting and strict mode validation
The library now provides detailed statistics about the scanning process, including the number of services and adapters registered, modules imported, and the duration of the scan. Additionally, a new strict mode is introduced that uses AST-based side-effect detection to warn about potential module-level side effects before importing modules. A scan\_plan() API is also added to preview what container.scan() would discover without actually importing any modules.
dioxide · high confidence
Release of the dioxide dependency injection library
The package has been renamed from rivet-di to dioxide, providing a modern, Rust-backed dependency injection framework for Python. This release introduces core features including profile-based component scanning, hexagonal architecture support via @adapter and @service decorators, and lifecycle management. The library now includes official integration modules for FastAPI, Django, Celery, and Click, alongside a testing utility (fresh\_container) and a pure-Python container for benchmarking. Users can now resolve dependencies by port or service, manage component lifecycles, and swap infrastructure implementations based on environment profiles (e.g., TEST vs PRODUCTION).
python/dioxide · high confidence
Removals
Removed Python DI module from rivet-di
The Python implementation of the rivet-di dependency injection module has been removed. This includes the Container class, the @component decorator, and the Scope enum, which previously provided declarative dependency injection with Rust-backed core integration. Users relying on these Python-side components will need to use alternative approaches or wait for the Rust core to be exposed through a new Python interface.
_python/rivet\di · high confidence
Behavioural changes
Replace live-rendered Mermaid diagrams with pre-rendered SVGs
The documentation build process now converts Mermaid diagram code blocks into static SVG images during the build, rather than rendering them live in the browser. This change improves page load performance and ensures consistent rendering across all browsers. The new pipeline includes scripts to extract Mermaid blocks from documentation files, render them as SVGs using the 'beautiful-mermaid' library with a Catppuccin Mocha theme, and update the source markdown files to reference the generated SVGs instead of the raw code blocks. Additionally, a new \docs-serve.sh\ script provides a live-reload development server for the documentation.
scripts · high confidence
Rust core implements distinct singleton and transient factory registration
The Rust core now supports registering both singleton and transient factory providers, allowing users to choose whether a dependency is cached or created fresh each time. The container also enforces uniqueness by preventing duplicate registrations and provides specific error types for missing or conflicting dependencies.
rust · high confidence
Test coverage
Add BDD acceptance tests for the dioxide DI container and API; Added FastAPI example test suite; Added migration examples and tests for dependency-injector and injector; Added performance benchmarking infrastructure and test suite; Added test fixtures and comprehensive test suite for dioxide; Added type-checking tests for lifecycle and container usage; New BDD acceptance tests for API ergonomics, stability, and performance.
Dependencies
Rename to dioxide and upgrade Rust dependencies
The project has been renamed from rivet-di to dioxide, with the Python package and Rust library updated to version 2.1.0. The Rust dependency pyo3 has been upgraded from 0.20 to 0.28, and petgraph from 0.6 to 0.8. Additionally, a new diagram-tools utility was added to the scripts directory, introducing the beautiful-mermaid npm package for handling Mermaid diagrams.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 71 → 83 (+11.8)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 86 → 90 (+4.5)
- Architecture 100 → 93 (-7.3)
- Maturity 79 → 80 (+1.5)
- Readiness 80 → 81 (+1.0)
- Security 58 → 85 (+27.3)
- Domain Modelling 100 → 100 (+0.0)
Resolved (75)
- Build action pinned to a mutable branch
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (11 lines × 2) (examples/migrations/from-injector/after/app/adapters.py)
- Duplicated block (11 lines × 2) (python/dioxide/container.py)
- Duplicated block (12 lines × 2) (examples/migrations/from-dependency-injector/after/app/main.py)
- Duplicated block (12 lines × 2) (examples/migrations/from-dependency-injector/after/app/services.py)
- Duplicated block (13 lines × 2) (examples/migrations/from-injector/after/app/main.py)
- Duplicated block (13 lines × 4) (python/dioxide/container.py)
- Duplicated block (14 lines × 2) (examples/migrations/from-injector/after/app/services.py)
- Duplicated block (14 lines × 2) (examples/migrations/from-injector/after/app/services.py)
- Duplicated block (14 lines × 2) (python/dioxide/exceptions.py)
- Duplicated block (15 lines × 2) (python/dioxide/container.py)
- Duplicated block (18 lines × 4) (python/dioxide/celery.py)
- Duplicated block (20 lines × 2) (features/steps/scan_performance_steps.py)
- Duplicated block (20 lines × 3) (python/dioxide/django.py)
- Duplicated block (21 lines × 2) (examples/patterns/circular-deps/solution.py)
- Duplicated block (23 lines × 2) (demos/scripts/build-demo.py)
- Duplicated block (8 lines × 2) (python/dioxide/container.py)
- Duplicated block (8 lines × 2) (python/dioxide/container.py)
- …and 55 more
New (65)
- Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
- Documentation: no installation or build instructions (README.md)
- Documentation: no installation or build instructions (docs/label-guide.md)
- Documentation: no usage examples (README.md)
- Duplicated block (11 lines × 2) (demos/rust-correctness/correct_wiring.py)
- Duplicated block (12 lines × 2) (examples/migrations/from-injector/after/app/adapters.py)
- Duplicated block (13 lines × 2) (examples/migrations/from-dependency-injector/after/app/services.py)
- Duplicated block (14 lines × 2) (python/dioxide/exceptions.py)
- Duplicated block (15 lines × 2) (examples/migrations/from-dependency-injector/after/app/main.py)
- Duplicated block (17 lines × 4) (python/dioxide/celery.py)
- Duplicated block (18 lines × 2) (python/dioxide/django.py)
- Duplicated block (18–23 lines × 2) (features/steps/scan_performance_steps.py)
- Duplicated block (19 lines × 2) (examples/migrations/from-injector/after/app/main.py)
- Duplicated block (19 lines × 2) (examples/migrations/from-injector/after/app/services.py)
- Duplicated block (19 lines × 2) (examples/patterns/circular-deps/solution.py)
- Duplicated block (20 lines × 2) (demos/migration-tool/v1_app.py)
- Duplicated block (23–34 lines × 4) (python/dioxide/container.py)
- Duplicated block (26 lines × 2) (examples/migrations/from-injector/after/app/services.py)
- Duplicated block (28 lines × 2) (demos/scripts/build-demo.py)
- Duplicated block (45 lines × 2) (examples/click/app/domain/services.py)
- …and 45 more
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mikelane/dioxide 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 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 3b7e449084193c0625d52246010562f4c0ac30af — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.