aiocron
Crontabs for asyncio
What it is and what it does
aiocron brings crontab scheduling to asyncio applications by providing a decorator and object interface for running async functions on cron schedules. It parses standard crontab expressions (with optional seconds) and integrates directly into the asyncio event loop, allowing you to schedule periodic tasks without blocking.
The package depends on cronsim, python-dateutil, and tzlocal to handle cron expression parsing and timezone-aware scheduling. It supports three usage patterns: a decorator that auto-starts, a decorator with manual start/stop control, and an awaitable interface for one-off scheduled waits. The underlying cron syntax is delegated to croniter, so any expression croniter supports will work here.
Use it for:
- Schedule periodic cleanup or maintenance tasks in long-running async services without spawning background threads.
- Run async database queries or API calls on a fixed schedule within an event-driven application.
- Implement time-based alerts or notifications that trigger at specific hours/days without blocking other coroutines.
- Coordinate batch processing jobs across multiple async tasks using cron timing rules.
- Wait for the next occurrence of a specific time (e.g., next hour) within an async workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Schedules async functions to run on cron schedules within asyncio event loops, supporting standard crontab syntax with optional second-level precision.
Yes, if you need cron scheduling in an asyncio application and accept the aging maintenance status. The package is stable (Production/Stable classifier), has no known vulnerabilities, low install friction, and covers a specific niche well. Not recommended if you require active development or frequent updates; consider it suitable for stable, non-critical scheduling in mature codebases.
Install
aiocron on PyPI
pip
pip install aiocronuv
uv add aiocronpoetry
poetry add aiocronInstalling aiocron
Before you install
Low install friction with pure Python wheels. Maintenance is aging—last commit was 2025-09-28 but no release since 2025-02-14, though the repository remains active and not archived. Suitable for stable, non-critical scheduling tasks.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial projects.
Quickstart
import aiocron
import asyncio
@aiocron.crontab('*/30 * * * *')
async def attime():
print('run')
asyncio.get_event_loop().run_forever()
Requires Python 3.9 or later and an active asyncio event loop to execute scheduled tasks.
Verify before relying
- Whether the package handles timezone-aware scheduling correctly across DST transitions.
- Performance characteristics under high-frequency scheduling (e.g., many concurrent cron jobs).
- Behavior when cron expressions resolve to no matching times in a given period.
Package facts
| License | MIT License Copyright (c) 2016 Gael Pasgrimaud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — cronsim, python-dateutil, tzlocal |
| Maintenance | aging — 546 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 325,686/month — #7,584 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiocron-2.1-py3-none-any.whl
Keywords: crontab, cron, asyncio
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
django-crontabIntegrates system crontab scheduling into…
permissive · top 15,000 on PyPI
scheduleSchedule provides a human-friendly API for…
permissive · top 5,000 on PyPI
python-crontabReads, writes, and manipulates system crontab…
copyleft · top 5,000 on PyPI
crontabParses crontab schedule expressions and…
copyleft · top 5,000 on PyPI
rq-schedulerAdds job scheduling capabilities to RQ (Redis…
permissive · top 15,000 on PyPI
local-crontabConverts crontab expressions from a local…
permissive · top 15,000 on PyPI
APSchedulerAPScheduler lets you schedule Python code to…
permissive · top 1,000 on PyPI
cronitercroniter iterates over datetime objects using…
permissive · top 1,000 on PyPI
schedulerAn in-process job scheduler for Python that…
copyleft · top 15,000 on PyPI
pycronParses cron-style schedule strings and…
permissive · top 5,000 on PyPI