whatisgithub

What is apscheduler?

agronholm/apscheduler — explained in plain English

Analysis updated 2026-06-24

7,485PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Python library for running tasks automatically on schedules or in a queue, supports cron-style timing, fixed intervals, and one-off jobs, and works across multiple servers with persistent storage.

Mindmap

mindmap
  root((APScheduler))
    Schedule types
      Cron-style
      Fixed interval
      Calendar-based
      One-off date
    Runtime support
      Thread-based
      asyncio
      Trio
    Storage backends
      PostgreSQL
      MySQL
      SQLite
      MongoDB
    Event brokers
      Redis
      MQTT
      PostgreSQL
    Job controls
      Max concurrent copies
      Start deadline
      Random jitter
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Schedule a Python function to run every night at midnight using cron-style syntax without setting up an external tool like cron or Celery.

USE CASE 2

Run background jobs reliably across multiple web servers by storing schedules in PostgreSQL so jobs survive server restarts.

USE CASE 3

Add a task queue to a FastAPI or Django app that processes jobs asynchronously using asyncio without a separate broker service.

USE CASE 4

Set up a monthly billing job that always fires on the same day of the month regardless of varying month lengths.

What is it built with?

PythonasyncioTrioPostgreSQLMySQLSQLiteMongoDBRedis

How does it compare?

agronholm/apschedulerlearningcircuit/local-deep-researchhips/autograd
Stars7,4857,4877,488
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/53/52/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Distributed setups need an external database (PostgreSQL/MySQL) and optionally Redis or MQTT for event brokering.

No license information was mentioned in the explanation.

So what is it?

APScheduler (Advanced Python Scheduler) is a task scheduling and task queue library for Python. It allows developers to set up jobs that run automatically at specific times, on repeating schedules, or after fixed intervals, without building that infrastructure from scratch. It can also act as a plain job queue if time-based scheduling is not needed. The library supports four built-in scheduling patterns. Cron-style scheduling targets specific times or days in a familiar format. Interval-based scheduling runs tasks every fixed number of minutes, hours, or similar units. Calendar-based scheduling runs tasks at intervals measured in months or years, always at the same time of day. One-off scheduling runs a task exactly once at a specific date and time. These patterns can be mixed and matched using combining triggers for more complex needs. APScheduler works with both traditional thread-based Python code and asynchronous code using asyncio or Trio. It integrates with web applications built on WSGI or ASGI frameworks, making it a practical fit for most Python web stacks. For applications spread across multiple servers or processes, APScheduler supports persistent storage so schedules and jobs survive process restarts. Storage backends include PostgreSQL, MySQL, SQLite, and MongoDB. When using multiple scheduler or worker instances together, event brokers handle coordination between them. The built-in broker options are PostgreSQL, Redis, and MQTT. Jobs stored in the shared data store are visible to all nodes, allowing both reliability and horizontal scaling. Extra controls include a cap on how many concurrent copies of the same job can run, a deadline for how late a job is allowed to start before being skipped, and optional jitter (a small random delay added to each job) to avoid all jobs firing at the exact same instant. The current v4 series is a pre-release, and the project advises against using it in production.

Copy-paste prompts

Prompt 1
Using APScheduler v4 with asyncio, write a Python script that runs a function every 30 minutes and also runs a separate function every day at 9am using cron syntax.
Prompt 2
I have an APScheduler job that hits an external API. Show me how to set a max_instances limit so only one copy runs at a time, and configure a deadline so late-firing jobs are skipped.
Prompt 3
Set up APScheduler with a PostgreSQL job store so that scheduled jobs persist across application restarts. Show the connection string setup and how to add a job to the persistent store.
Prompt 4
I want to add random jitter to my APScheduler interval jobs to avoid thundering-herd on my database. Show me the trigger configuration to add up to 60 seconds of jitter to an every-5-minute job.
Prompt 5
Configure APScheduler to coordinate jobs across three worker processes using a Redis event broker and a shared PostgreSQL data store.

Frequently asked questions

What is apscheduler?

A Python library for running tasks automatically on schedules or in a queue, supports cron-style timing, fixed intervals, and one-off jobs, and works across multiple servers with persistent storage.

What language is apscheduler written in?

Mainly Python. The stack also includes Python, asyncio, Trio.

What license does apscheduler use?

No license information was mentioned in the explanation.

How hard is apscheduler to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is apscheduler for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.