MCPcopy Index your code
hub / github.com/dymmond/asyncz

github.com/dymmond/asyncz @0.15.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.15.0 ↗ · + Follow
1,237 symbols 4,846 edges 168 files 376 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Asyncz

Asyncz

<em>🚀 The scheduler that simply works. 🚀</em>

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:

Core symbols most depended-on inside this repo

append
called by 65
asyncz/contrib/dashboard/logs/storage.py
get
called by 59
asyncz/contrib/dashboard/controllers/home.py
add_task
called by 55
docs_src/stores/custom.py
maybe_await
called by 36
asyncz/cli/utils.py
start
called by 33
asyncz/stores/base.py
get_next_trigger_time
called by 28
asyncz/triggers/cron/trigger.py
start
called by 20
asyncz/schedulers/asyncio.py
get_next_value
called by 18
asyncz/triggers/cron/fields.py

Shape

Method 656
Function 408
Class 159
Route 14

Languages

Python100%
TypeScript1%

Modules by API surface

tests/test_schedulers.py122 symbols
tests/test_triggers.py78 symbols
tests/test_utils.py63 symbols
asyncz/schedulers/base.py52 symbols
tests/test_stores.py44 symbols
asyncz/contrib/dashboard/controllers/tasks.py44 symbols
asyncz/schedulers/types.py41 symbols
asyncz/triggers/cron/expressions.py34 symbols
tests/test_tasks.py32 symbols
tests/test_cron_expressions.py26 symbols
tests/dashboard/test_controllers.py24 symbols
asyncz/utils.py21 symbols

Datastores touched

(mongodb)Database · 1 repos
asynczDatabase · 1 repos

For agents

$ claude mcp add asyncz \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact