Skip to content

Asyncz

Asyncz

🚀 The scheduler that simply works. 🚀

Test Suite Package version Supported Python versions


Documentation: https://asyncz.dymmond.com 📚

Source Code: https://github.com/dymmond/asyncz


Asyncz is a production scheduler for async Python applications and ASGI services. It keeps the familiar scheduler / trigger / store / executor model, but it is built around asyncio, explicit task objects, framework lifecycle integration, durable stores, predictable Python logging, and operator tooling that works from both the CLI and the dashboard.

Asyncz is designed for scheduled work that operators need to understand and control. You can inspect a task before changing it, preview future run times without mutating trigger state, trigger a task manually, review a diff before editing supported metadata, and inspect the run history and logs afterward.

Why Asyncz

  • AsyncIOScheduler for regular async applications.
  • NativeAsyncIOScheduler for environments that already own the event loop.
  • Built-in triggers for one time work, recurring intervals, cron expressions, combinations, and shutdown hooks.
  • Multiple persistence options for local development and production deployments.
  • CLI tooling for version checks, diagnostics, instances visible in the current process, add, update, list, inspect, preview, timeline, status, run, pause, resume, and remove workflows.
  • Dashboard tooling for task control, task detail pages, links to logs for each task, edit previews, bulk actions, manual Run now, runtime identity, instances visible in the current process, timeline previews, scheduler events, audit trail, run history, and log inspection for each run.
  • Packaged dashboard assets for Tailwind CSS, Alpine.js, HTMX, Toastify, and the favicon.

Install

pip install asyncz

Optional extras:

pip install "asyncz[dashboard]"
pip install "asyncz[localtime]"

Quick start

import logging

from asyncz.schedulers import AsyncIOScheduler

logging.basicConfig(level=logging.INFO)

scheduler = AsyncIOScheduler()


def cleanup() -> None:
    logging.getLogger(__name__).info("cleanup finished")


scheduler.add_task(cleanup, "interval", minutes=5, id="cleanup-task")
scheduler.start()

Operate a durable task

asyncz add myapp.tasks:cleanup \
  --id cleanup-task \
  --name cleanup \
  --interval 5m \
  --store durable=sqlite:///scheduler.db

asyncz inspect cleanup-task --count 5 --store durable=sqlite:///scheduler.db
asyncz update cleanup-task --max-instances 2 --dry-run --store durable=sqlite:///scheduler.db
asyncz run cleanup-task --store durable=sqlite:///scheduler.db
  • Schedulers for configuration, lifecycle, and logging.
  • Triggers for scheduling rules.
  • Tasks for task objects, decorator mode, and lifecycle generators.
  • Shapes for validator-agnostic scheduler representation.
  • Stores for persistence and encryption.
  • Executors for runtime execution strategy.
  • ASGI and Context Managers for framework integration.
  • CLI for operational workflows.
  • Dashboard for the optional admin UI, run history, and logs.

Logging

Asyncz uses Python's logging module. The default logger namespaces are:

  • asyncz.schedulers
  • asyncz.executors.<alias>
  • asyncz.stores.<alias>

If you need custom logger creation, pass a custom loggers_class when constructing the scheduler.

The dashboard log viewer can additionally filter captured records by task id, run id, level, and message text.

Persistence and encryption

The default store is memory. For durable scheduling, Asyncz also ships with file, mongodb, redis, and sqlalchemy stores.

Persistent stores support ASYNCZ_STORE_ENCRYPTION_KEY. When it is set, serialized task payloads are encrypted before they are written to the backing store.