Skip to main content

ashka

CI Publish Update dishka

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.BOOTSTRAP to the scope parameter of ashka.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 with container.init() or automatically by entering the container context manager.
  • Each ashka integration provides a consistent get_container function. It retrieves the container passed to setup_dishka from the integrated framework application, router, broker, context, or other supported object.
  • The central ashka.integrations.setup_dishka and ashka.integrations.get_container functions 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_container
  • dishka.**.make_async_container -> ashka.**.make_async_container
  • dishka.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

ashka-0.8.8.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ashka-0.8.8-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file ashka-0.8.8.tar.gz.

File metadata

  • Download URL: ashka-0.8.8.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

Hashes for ashka-0.8.8.tar.gz
Algorithm Hash digest
SHA256 a1a8ad6bd015a51ca0bcf0313249d70b5e74fff914cbf1c93a54f8998454c1f7
MD5 86884d6173dcc589f74fbd8ee558c885
BLAKE2b-256 35ce9997750d7159f7e76f71a88fde46249aee5554b88b59e68586c8590966c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ashka-0.8.8.tar.gz:

Publisher: publish.yml on handsome-Druid/ashka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ashka-0.8.8-py3-none-any.whl.

File metadata

  • Download URL: ashka-0.8.8-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

Hashes for ashka-0.8.8-py3-none-any.whl
Algorithm Hash digest
SHA256 574c999c856e16ca9a4811dd797bf730fa6db2255341699c639324ac4d435e91
MD5 23ddb23735e9621d47f620f129e909be
BLAKE2b-256 a97363085b9105cb8967d66856796d2112cc47fd5ecbd800ee6cec762c9c0cfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ashka-0.8.8-py3-none-any.whl:

Publisher: publish.yml on handsome-Druid/ashka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

This release

0.8.8 This release

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.1

2 files

0.8.0

2 files

0.6.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page