{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/9"}],"enrichment":{"capability":"Integrates the injector dependency-injection library with FastAPI, enabling constructor-based injection of dependencies into route handlers and application code.","skillfed_tags":["dependency-injection","fastapi-integration","ioc-container"],"use_cases":["Implement onion/hexagonal architecture where domain use cases depend on abstract ports and FastAPI routes inject concrete repository implementations.","Manage per-request database connections or transaction scopes by binding them to request scope and injecting them into multiple route handlers.","Decouple route handlers from concrete service implementations, making unit tests easier by swapping real services for mocks via injector bindings.","Share expensive resources (connection pools, caches) across multiple dependencies within a single request without passing them through function signatures.","Build modular FastAPI applications where different routers can depend on the same injected services without tight coupling."],"what_it_does":"fastapi-injector bridges the injector library (a mature Python dependency-injection container) with FastAPI's dependency system. It lets you define your application's object graph separately from your routes, then inject dependencies into handlers using the Injected marker. This is useful for layered architectures where domain logic (use cases, repositories) lives in inner layers and depends on abstract interfaces, while concrete implementations are bound and provided by the injector in the outer FastAPI layer.\n\nThe package includes a RequestScope for per-request caching (so the same instance is reused within a single request but fresh instances are created for new requests), middleware integration, support for both async and sync dependencies, and automatic cleanup of context-manager resources at request end. It requires Python 3.10 or later and depends only on injector.","worth_installing":"Yes, with conditions. Install if you need constructor-based dependency injection in FastAPI and are comfortable with a permissive BSD license and aging maintenance (308 days since last release). The package is stable and has no known vulnerabilities, but expect slower issue resolution. Skip if you prefer lighter-weight solutions or need active maintenance and rapid updates."},"id":"fastapi-injector","links":{"html":"https://skillfed.io/packages/fastapi-injector","md":"https://skillfed.io/packages/fastapi-injector.md","pypi":"https://pypi.org/project/fastapi-injector/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-10-10","license_spdx":null,"license_treatment":"permissive","name":"fastapi-injector","python_support":"supports_current","summary":"python-injector integration for FastAPI"},"popularity":{"monthly_downloads":117641,"position":12155,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.9.0"}
