ashka
ashka extends reagento/dishka with async/sync application lifecycle support.
The a prefix lets ashka sort before dishka, helping ensure the correct
import order. The name also means async application lifecycle support, which can
speed up startup compared with serially initializing components in a lifespan
function.
Installation
Install ashka[lifecycle] to enable all features, including Bootstrap
lifecycle support, AshkaScope.BOOTSTRAP, and explicit or context-managed
container initialization. This installation also further patches and extends
dishka's internal container implementations so that dependencies can be
initialized during the Bootstrap phase.
If Bootstrap lifecycle support is not needed, install ashka without the
extra. This provides the dishka monkey patches, supported framework
integrations, unified container access, and type-dispatched integration setup,
but does not provide the Bootstrap lifecycle APIs. In this mode, ashka only
patches the integration layer rather than dishka's container internals, so its
runtime impact is significantly smaller and should be nearly unnoticeable.
Documentation
Current Features
- Pass
AshkaScope.BOOTSTRAPto thescopeparameter ofashka.provide, for example@ashka.provide(scope=ashka.AshkaScope.BOOTSTRAP), to register a dependency in the APP scope and create it when the container is initialized. Both synchronous and asynchronous containers can be initialized explicitly withcontainer.init()or automatically by entering the container context manager. - Each ashka integration provides a consistent
get_containerfunction. It retrieves the container passed tosetup_dishkafrom the integrated framework application, router, broker, context, or other supported object. - The central
ashka.integrations.setup_dishkaandashka.integrations.get_containerfunctions automatically dispatch to the corresponding integration based on the type of the object passed to them. - Integrations are available for Aiogram, Aiohttp, ARQ, Celery, Click, FastAPI, Flask, Litestar, Sanic, Starlette, Taskiq, and Telebot. FastStream is available as a manual opt-in integration.
Patched Implementations
dishka.**.make_container->ashka.**.make_containerdishka.**.make_async_container->ashka.**.make_async_containerdishka.integrations.*.setup_dishka->ashka.integrations.*.setup_dishka
These monkey patches keep the API paths consistent with upstream dishka and
reduce the cognitive load during migration. Import ashka before importing
these dishka APIs so existing projects can keep their current imports without
immediate code changes. This is a migration aid rather than a stable usage
pattern; migrate imports from dishka to ashka incrementally when convenient
instead of relying on the monkey patches indefinitely.
See FastStream support for its support status and manual opt-in.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ashka-0.8.7.tar.gz.
File metadata
- Download URL: ashka-0.8.7.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93edc0619ac583e4fd1b4766471c0671b9a50669cba8348405068156fb40d689
|
|
| MD5 |
f5f70186620e668156e088f0cc230530
|
|
| BLAKE2b-256 |
5acfd2e11770de343eda5d016ddd0514ba67d9b6d0a9bf6011acfab7c7c39253
|
Provenance
The following attestation bundles were made for ashka-0.8.7.tar.gz:
Publisher:
publish.yml on handsome-Druid/ashka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ashka-0.8.7.tar.gz -
Subject digest:
93edc0619ac583e4fd1b4766471c0671b9a50669cba8348405068156fb40d689 - Sigstore transparency entry: 2581168680
- Sigstore integration time:
-
Permalink:
handsome-Druid/ashka@741494fc01e92e7bc122bb67a5340f06d64a87b1 -
Branch / Tag:
refs/tags/v0.8.7 - Owner: https://github.com/handsome-Druid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@741494fc01e92e7bc122bb67a5340f06d64a87b1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ashka-0.8.7-py3-none-any.whl.
File metadata
- Download URL: ashka-0.8.7-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f004daa90337c7daf2d6a8ab1cb498d57db6ad15131cc03c17fb01bd1aaf7209
|
|
| MD5 |
b27fe6143c0e89f6f6ce32d0ae487c63
|
|
| BLAKE2b-256 |
e7c8b6529092b3ace32ccb5e018653387c4c71fb14d10a372f5aa0018c318de8
|
Provenance
The following attestation bundles were made for ashka-0.8.7-py3-none-any.whl:
Publisher:
publish.yml on handsome-Druid/ashka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ashka-0.8.7-py3-none-any.whl -
Subject digest:
f004daa90337c7daf2d6a8ab1cb498d57db6ad15131cc03c17fb01bd1aaf7209 - Sigstore transparency entry: 2581168693
- Sigstore integration time:
-
Permalink:
handsome-Druid/ashka@741494fc01e92e7bc122bb67a5340f06d64a87b1 -
Branch / Tag:
refs/tags/v0.8.7 - Owner: https://github.com/handsome-Druid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@741494fc01e92e7bc122bb67a5340f06d64a87b1 -
Trigger Event:
push
-
Statement type: