skillfed

aiocron

Crontabs for asyncio

aiocron v2.1 325.7K downloads/30d#7,584 on PyPI377
Permissive 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) AGING released

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 aiocron

uv

uv add aiocron

poetry

poetry add aiocron

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: POSIXProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

asyncio cron schedulerasync task schedulingcrontab for asyncioperiodic async executioncron decorator pythonschedule async functionsasyncio job scheduling
asyncioschedulingcron

More Python Modules packages