{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/5"}],"enrichment":{"capability":"dishka is an IoC container that manages dependency injection with support for multiple scopes and resource finalization, letting you define how and when dependencies are created and released.","skillfed_tags":["dependency-injection","ioc-container","scope-management"],"use_cases":["Web application request handling: create app-level singletons (database pools, config) and request-level instances (services, DAOs) with automatic cleanup.","Modular service architecture: split dependency factories into reusable provider classes instead of monolithic configuration.","Resource management: define cleanup logic (e.g., closing connections) alongside creation, ensuring resources are released when scopes exit.","Testing: swap real implementations for mocks by providing alternate providers without changing application code.","Multi-scope applications: manage dependencies with custom lifetimes beyond just app and request (e.g., per-user, per-transaction).","Framework integration: use built-in middleware or decorators to wire dishka into FastAPI, Starlette, or other supported frameworks."],"what_it_does":"dishka is a dependency injection container that solves the problem of passing objects through layers of constructors by centralizing dependency creation and lifecycle management. It lets you define providers that specify how to create dependencies, assign them to scopes (app-wide, per-request, or custom), and automatically handle resource cleanup when scopes end. The library focuses narrowly on DI without mixing in configuration, logging, or other concerns.\n\nYou define your classes with type hints, create providers that specify factories and scopes, combine them into a container, and then retrieve dependencies through the container. Higher-scoped dependencies (like app-level singletons) are accessible from lower scopes (like request-level), and finalization hooks let you close database connections or release other resources when a scope ends. It supports multiple Python versions from 3.10 onward and integrates with popular web frameworks.","worth_installing":"Yes. dishka is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real problem\u2014managing complex object graphs without global state or scattered markers. It's a good fit if you're building a modular application with multiple dependency scopes or need resource finalization. Not necessary for small scripts or projects with simple, flat dependencies."},"id":"dishka","links":{"html":"https://skillfed.io/packages/dishka","md":"https://skillfed.io/packages/dishka.md","pypi":"https://pypi.org/project/dishka/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-25","license_spdx":"Apache-2.0","license_treatment":"permissive","name":"dishka","python_support":"supports_current","summary":"Cute DI framework with scopes and agreeable API"},"popularity":{"monthly_downloads":636639,"position":5623,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.10.1"}
