TL;DR
FastScheduler is an open-source Python scheduler that uses a decorator-first API to register interval, time-based, cron and one-off jobs. It includes async/await support, timezone handling, persistent state, retries and timeouts, plus an optional FastAPI dashboard for real-time monitoring.
What happened
FastScheduler is a lightweight Python library that lets developers declare scheduled tasks with a concise decorator-based API. Jobs can be defined for intervals, daily/hourly/weekly times, cron expressions or one-time execution; the scheduler accepts both synchronous and native async functions. It includes timezone support (via a tz parameter or a chainable .tz() method) and persists state to disk so job definitions, execution history and counters survive restarts. The runtime can optionally perform catch-up on missed runs or skip them with a no_catch_up() modifier. Reliability features include automatic retries with exponential backoff, configurable per-job timeouts, and a dead letter queue that records failed executions. For observability and control, FastScheduler offers an optional FastAPI integration that exposes a real-time dashboard (SSE updates), REST endpoints for job management and execution history, and programmatic access through a small API.
Why it matters
- Decorator-based API reduces boilerplate when scheduling tasks and embeds schedules near the function definition.
- Built-in async/await support and per-job timeouts make it suitable for I/O-bound async workloads.
- Persistent state and a dead letter queue improve reliability and post-failure debugging after process restarts.
- FastAPI dashboard and REST/SSE endpoints provide runtime visibility and remote control without custom tooling.
Key facts
- Installation is available via pip; core package is pip install fastscheduler, with extras pip install fastscheduler[fastapi], pip install fastscheduler[cron] or pip install fastscheduler[all].
- Scheduling styles include interval-based (.every(n).seconds/minutes/hours/days), time-based (daily.at, hourly.at, weekly.<day>.at), cron expressions and one-time jobs (.once(seconds) and .at(datetime)).
- Timezone handling supports a tz parameter and a chainable .tz("Zone") modifier; examples include America/New_York and Asia/Tokyo.
- Retries are configurable per job and use exponential backoff (example backoff sequence shown as 2s, 4s, 8s, …).
- Per-job timeouts can be set to kill long-running tasks automatically (.timeout(seconds)).
- State persistence writes job definitions, history and statistics to disk; default state file name is fastscheduler_state.json unless changed.
- Dead letter queue stores failed runs up to a configurable limit (default max_dead_letters = 500) and is persisted to a separate *_dead_letters.json file.
- FastAPI integration exposes a dashboard at /scheduler/ (with SSE for real-time updates) and REST endpoints such as /scheduler/api/jobs, /scheduler/api/history and /scheduler/events.
- Configuration options include auto_start, quiet, max_workers (default 10), max_history (default 10000) and history_retention_days (default 7).
What to watch next
- not confirmed in the source: community adoption and contribution activity on the project repository.
- not confirmed in the source: formal roadmap for additional features, long-term maintenance or enterprise support.
- not confirmed in the source: performance and behaviour under large-scale or high-concurrency job loads.
Quick glossary
- Decorator: A Python language feature that wraps a function to modify or extend its behavior; used here to attach scheduling metadata to task functions.
- Cron expression: A compact string format for specifying complex recurring schedules (minutes, hours, day-of-month, month, day-of-week).
- Timezone: A named region (for example, America/New_York) that determines local time offsets and daylight-saving rules used when scheduling jobs.
- Dead letter queue: A store for failed job executions used to inspect errors and retry or debug problematic tasks.
- Server-Sent Events (SSE): A unidirectional web mechanism that pushes real-time updates from a server to a browser client over HTTP.
Reader FAQ
How do I install FastScheduler?
Install the core package with pip install fastscheduler; add extras for the FastAPI dashboard with pip install fastscheduler[fastapi] or for cron support with pip install fastscheduler[cron].
Does it support async functions?
Yes — FastScheduler supports native async/await functions alongside synchronous callables.
Will scheduled jobs survive a process restart?
Yes. FastScheduler persists job definitions, execution history and counters to disk and restores them on restart; it can optionally run catch-up for missed executions unless no_catch_up() is set.
What license is the project released under?
not confirmed in the source
FastScheduler Simple, lightweight task scheduler for Python with async support, timezone handling, cron expressions, and a beautiful real-time dashboard. If this saves you time, ⭐️ the repo and open an…
Sources
- Show HN: FastScheduler – Decorator-first Python task scheduler, async support
- Decorator-first Python task scheduler, async support
- Stop Overengineering Your Python Schedulers — Here's …
- How to run an async function through the task scheduler …
Related posts
- DebtBomb: enforce expiring TODO comments and integrate with Jira
- Command K Bars: Keyboard-Triggered Command Palettes Reshaping GUIs
- SnackBase: Open-source GxP-compliant Python backend with immutable logs