Skip to main content

asynk

asynk is a lightweight asyncio task framework for Python 3.11+, built on the standard library only. Define tasks with a decorator, publish them with delay, and run them in workers, behind any broker you plug in.

Documentation: https://marquesch.github.io/asynk/

Install

pip install asynk

Example

"""The smallest asynk app: one task, published and run in the same process."""

import asyncio

from asynk import App, MemoryStore, Worker
from asynk.transport.memory import memory_transport

producer, consumer = memory_transport()
app = App("first-app", producer=producer, consumer=consumer, store=MemoryStore())


@app.task()
async def add(a: int, b: int) -> int:
    return a + b


async def main() -> None:
    worker = Worker(app)
    run = asyncio.create_task(worker.run())

    handle = await add.delay(2, b=3)
    print("2 + 3 =", await handle.result(timeout=5))

    worker.request_shutdown()
    await run


if __name__ == "__main__":
    asyncio.run(main())

With a broker transport, producers and workers run in separate processes; start a worker with asynk worker tasks:app.

Why asynk

  • Decoupled producers and consumers: the core only knows an envelope, a codec and two small protocols, so any broker can sit behind them.
  • Pluggable transport and store: bring your own broker and result store; an in-memory transport and store ship for development and tests, and a Redis store and a Redis transport come with asynk[redis].
  • Type-checked delay: calls are checked against the task's signature.
  • Cron scheduled tasks with per-slot dedupe when schedulers share a store.
  • Task results through a store, with states and awaitable handles.
  • Retries with backoff: a retry policy per app or per task, with exponential backoff and an exception filter.
  • Lifecycle hooks shared by workers and the scheduler.
  • Middleware around every task: timing, metrics, vetoes, cleanup.
  • OpenTelemetry traces and metrics, switched on by installing asynk[otel].
  • Health probes and graceful shutdown, ready for Kubernetes.

Learn more

License

MIT, see LICENSE.

Metadata

Release files for asynk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asynk 0.3.0
File Size Uploaded Provenance Actions
asynk-0.3.0.tar.gz 45.1 kB With provenance Details for asynk-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asynk 0.3.0
File Interpreter ABI Platform Actions
asynk-0.3.0-py3-none-any.whl Python 3 none any Details for asynk-0.3.0-py3-none-any.whl

Total release size: 103.5 kB

Release files / asynk-0.3.0.tar.gz

Download URL asynk-0.3.0.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8d16819ccee978bc3a6be282ff6e10b5ffb9913afab302980f7d05f1d114fd46
BLAKE2b-256 checksum
How to use checksums
f54780c4e5f2362b11cd81f43b7be63854282eac677bc695d574b81b40aa54ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / asynk-0.3.0-py3-none-any.whl

Download URL asynk-0.3.0-py3-none-any.whl
Size 58.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96257fded0bad304356d422a3f4d4bc339c2154d5348cd72c404ac14b1736948
BLAKE2b-256 checksum
How to use checksums
f26cd2626d7fe942a8a7d012af096fcd92700a9bc69b6283533bac2b18612cb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for asynk 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asynk-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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