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.
  • Health probes and graceful shutdown, ready for Kubernetes.

Learn more

License

MIT, see LICENSE.

Metadata

Release files for asynk 0.2.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.2.0
File Size Uploaded Provenance Actions
asynk-0.2.0.tar.gz 40.9 kB With provenance Details for asynk-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 94.5 kB

Release files / asynk-0.2.0.tar.gz

Download URL asynk-0.2.0.tar.gz
Size 40.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dfbe22f23bf0e180d432fccf42b0930c082fa5ce7ceaadf5d78a7a14823631f8
BLAKE2b-256 checksum
How to use checksums
6e66be418a66d607cafebf28ecab813727be927c0fd859d22bfa6bcdb1de30e3
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.2.0-py3-none-any.whl

Download URL asynk-0.2.0-py3-none-any.whl
Size 53.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c601286affdda0982cde5a9ae5670b1bf24f76028d6d97d1ecaf04d8b58554f
BLAKE2b-256 checksum
How to use checksums
b4bef80da1522b0da670e888f46e896bf7144089e8abc6a66494a8517de93850
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.2.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.2.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