Dependency Injector
Description
Dependency Injector is a dependency injection framework for Python that provides declarative containers and providers to assemble and wire application components. It supports synchronous and asynchronous workflows, configuration management, provider overriding for tests, and integrates with popular web frameworks to keep service wiring explicit, testable, and maintainable.
General details
- Developer(s): Roman Mogylatov and the ETS Labs team.
- Open source: Yes
- Language(s): Python (with Cython extensions)
- Repository: https://github.com/ets-labs/python-dependency-injector
- License: BSD-3-Clause
- Operating system(s): OS Independent
- Actively maintained: Yes (latest release 4.48.3 on PyPI)
Intended use on the device
The SOUP is used in the medical device for the following specific purposes only:
- Define dependency injection containers that assemble infrastructure clients (databases, external APIs) and services with explicit wiring across microservices.
- Load configuration values from environment variables and configuration files into providers to keep service initialisation consistent across deployments.
- Override providers during automated tests to replace external integrations with stubs or mocks while exercising application logic.
Requirements
For the integration and safe usage of this SOUP within a software system, it's important to outline both functional and performance requirements. These requirements help mitigate risks and ensure compatibility and performance standards are met.
Functional
- Container and provider support: Offer declarative containers and provider types (e.g.,
Singleton,Factory,Resource,Configuration) to build and compose application dependencies. - Configuration loading: Allow configuration to be loaded from environment variables and common file formats (YAML/INI/JSON) and injected into providers.
- Framework integration: Support wiring with FastAPI and other frameworks to inject dependencies into routes, background tasks, and services.
- Provider overriding: Enable overriding of providers at runtime to facilitate testing, staging environments, and feature toggles.
- Async compatibility: Provide asynchronous-friendly providers and wiring so async services can be injected without blocking.
Performance
- Low overhead wiring: Perform dependency resolution with minimal latency during application startup and request handling.
- Resource management: Manage lifecycle of shared resources (for example, connection pools or clients) efficiently to avoid unnecessary instantiation.
- Scalability: Maintain predictable behaviour as the number of providers and wiring targets grows across services and modules.
- Thread/process safety: Ensure providers behave correctly in multi-threaded or multi-process deployment scenarios typical for web services.
System requirements
Establishing minimum software and hardware requirements is important to mitigate risks, such as security vulnerabilities, performance issues, or compatibility problems, and to ensure that the SOUP functions effectively within the intended environment.
Software
After evaluation, we find that there are no specific software requirements for this SOUP. It works properly on standard computing devices, which includes our environment.
Hardware
After evaluation, we find that there are no specific hardware requirements for this SOUP. It works properly on standard computing devices, which includes our environment.
Documentation
The official SOUP documentation can be found at https://python-dependency-injector.ets-labs.org/.
Additionally, a criterion for validating the SOUP is that all the items of the following checklist are satisfied:
- The vendor maintains clear and comprehensive documentation of the SOUP describing its functional capabilities, user guidelines, and tutorials, which facilitates learning and rapid adoption.
- The documentation for the SOUP is regularly updated and clearly outlines every feature utilized by the medical device, doing so for all integrated versions of the SOUP.
Related software items
We catalog the interconnections between the microservices within our software architecture and the specific versions of the SOUP they utilise. This mapping ensures clarity and traceability, facilitating both the understanding of the system's dependencies and the management of SOUP components.
Although the title of the section mentions software items, the relationship with SOUP versions has been established with microservices (also considered software items, by the way) because each one is inside a different Docker container and, therefore, has its own isolated runtime environment.
| Folder | dependency-injector version |
|---|---|
| projects/apps/control_plane | >=4.48.2 |
| projects/apps/experts/orchestrator | >=4.48.0 |
| projects/apps/report_builder | >=4.48.0 |
| projects/apps/ui/api_gateway | >=4.47.0 |
| projects/libs/expert_core | >=4.48.0 |
Related risks
The following are risks applicable to this SOUP from the table found in document R-TF-013-002 Risk management record_2023_001:
- 58. SOUP presents an anomaly that makes it incompatible with other SOUPs or with software elements of the device.
- 59. SOUP is not being maintained nor regularly patched.
- 60. SOUP presents cybersecurity vulnerabilities.
Lists of published anomalies
The incidents, anomalies, known issues or changes between versions for this SOUP can be found at:
History of evaluation of SOUP anomalies
09 Dec 2025
- Reviewer of the anomalies: Gerardo Fernández Moreno
- Version(s) of the SOUP reviewed: 4.48.3
No anomalies have been found.
Record signature meaning
- Author: JD-004
- Reviewer: JD-003
- Approver: JD-005