Skip to main content

The scheduler that nobody wants but every application needs.

Project description

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 an async-first scheduler for Python applications and ASGI services. It wraps the core APScheduler model in a codebase that is focused on asyncio, explicit task objects, pluggable stores and executors, and framework-friendly lifecycle integration.

Documentation: https://asyncz.dymmond.com

Highlights

  • AsyncIOScheduler and NativeAsyncIOScheduler for async runtimes.
  • Built-in triggers for date, interval, cron, and, or, and shutdown.
  • Built-in stores for memory, file, mongodb, redis, and sqlalchemy.
  • Executors for in-event-loop work, thread pools, process pools, and direct debug execution.
  • CLI commands for starting schedulers and managing persisted tasks.
  • Task inspection snapshots and filtered task queries for dashboards, CLIs, and admin tooling.
  • Optional dashboard UI for browsing tasks, filtering by schedule metadata, and viewing captured logs.
  • Standard-library logging throughout the project.

Installation

pip install asyncz

Useful 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()

Core concepts

Asyncz is built around four main component types:

Tasks are the public unit of scheduling. A task combines a callable, a trigger, an executor alias, and the metadata needed to persist and reschedule it correctly.

Logging

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

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

If you need custom logger creation, pass your own loggers_class to the scheduler. That class only needs to implement the same dictionary-like contract used by ClassicLogging.

ASGI integration

Asyncz can wrap an ASGI app directly:

from asyncz.schedulers import AsyncIOScheduler

scheduler = AsyncIOScheduler()
application = scheduler.asgi(application)

Or you can wire startup and shutdown hooks manually:

from asyncz.schedulers import AsyncIOScheduler

scheduler = AsyncIOScheduler()

app = Lilya(
    routes=[...],
    on_startup=[scheduler.start],
    on_shutdown=[scheduler.shutdown],
)

The scheduler also supports synchronous and asynchronous context managers, which makes it easy to use inside lifespan handlers.

Persistent stores and encryption

The default store is in-memory. For durable scheduling, configure a file, MongoDB, Redis, or SQLAlchemy store.

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

CLI and dashboard

Asyncz ships with:

  • a CLI for start, add, list, run, pause, resume, and remove
  • a Lilya-based dashboard with task controls, task filters, and a log viewer

See the documentation for usage details:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asyncz-0.15.0.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

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

asyncz-0.15.0-py3-none-any.whl (148.0 kB view details)

Uploaded Python 3

File details

Details for the file asyncz-0.15.0.tar.gz.

File metadata

  • Download URL: asyncz-0.15.0.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for asyncz-0.15.0.tar.gz
Algorithm Hash digest
SHA256 613d6f0e7338056bc3fbdf8c08e7c646d14a80fd5bf46d37b329a3c8cb6846b7
MD5 899fb9adf4b16fbb9260042e2aeec4ae
BLAKE2b-256 c0a84ff4760a8f668c1eefed953b537bfa932bbb90d2fa9cc2a9bf94fba46f51

See more details on using hashes here.

File details

Details for the file asyncz-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: asyncz-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 148.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.10.19 HTTPX/0.28.1

File hashes

Hashes for asyncz-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4621c2aa5ab617dce7d922038d8db50be1f562a8c66f7f7c7177ca92a0a15d28
MD5 784495a684eb5fa0fea7a8f7949a87f1
BLAKE2b-256 a3e66c0ca84effac6237f4b4487bbe0be885bbfaac25093c2ae2cf2838c6da53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page