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.1.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.1.0
File Size Uploaded Provenance Actions
asynk-0.1.0.tar.gz 37.7 kB With provenance Details for asynk-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 91.0 kB

Release files / asynk-0.1.0.tar.gz

Download URL asynk-0.1.0.tar.gz
Size 37.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8bfb05155b7f0a8b3bae5c300a9cd3c4541aa2b3d6854e2d338f85e48cde9c1c
BLAKE2b-256 checksum
How to use checksums
d521c2236c72a47024cc6929ec3477a33ab7135e2e145edb052d7449638024e0
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.1.0-py3-none-any.whl

Download URL asynk-0.1.0-py3-none-any.whl
Size 53.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
992c66fd00204e9adf15aa1246ea9cdd506cdd5fe1750f304180bf370ca8d06b
BLAKE2b-256 checksum
How to use checksums
ae9387e8e1d740f853a0b8cf6f7f868c4e4a507aa02d4aa3b87b0082a748f6a5
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.1.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.1.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