pycron
Simple cron-like parser, which determines if current datetime matches conditions.
What it is and what it does
Pycron is a lightweight cron schedule parser that evaluates whether a given datetime matches a cron-style schedule string. It implements standard cron syntax: wildcards (*), intervals (*/5), ranges (4-10), lists (6,8,23), and single values. The main entry point is `is_now(s, dt=None)`, which returns True if the provided datetime (or current time if omitted) matches the schedule. It also offers `has_been(s, since, dt=None)` for checking whether a schedule would have matched at any point in a past interval—useful for non-continuous applications. The package works with both timezone-aware and naive datetimes and supports alternative datetime libraries like Arrow, Delorean, Pendulum, and udatetime. Helper constants for Django form choices are included.
The package has no runtime dependencies and installs as a pure Python wheel, making it a minimal addition to any project. It's designed for simple scheduling logic rather than as a full task scheduler; typical use cases include checking whether a background job should run now or validating cron expressions in configuration.
Use it for:
- Validate whether a scheduled task should execute at the current moment in a non-continuous application.
- Check if a specific datetime matches a user-provided cron schedule string in a web form or API.
- Generate Django form choice lists for minute, hour, day-of-month, month, and day-of-week cron fields.
- Determine if any point in a past time window matched a schedule (anacron-like behavior for catch-up jobs).
- Parse and evaluate cron expressions in configuration files or database records.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses cron-style schedule strings and determines whether a given datetime matches the schedule, supporting standard cron syntax like intervals, ranges, lists, and wildcards.
Yes. Pycron is a stable, dependency-free utility for cron schedule matching with no known vulnerabilities. It supports current Python versions and is suitable for any project needing to evaluate cron expressions. The aging maintenance status is not a blocker—the package is mature and unlikely to require frequent updates. Install it if you need simple cron parsing without the overhead of a full task scheduler.
Install
pycron on PyPI
pip
pip install pycronuv
uv add pycronpoetry
poetry add pycronInstalling pycron
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last commit was 2025-10-08, but the package has been stable since its 2015-11-18 first release and supports current Python versions (3.9–3.13).
License in practice
MIT license is permissive; you can use, modify, and distribute pycron freely in commercial and private projects with minimal restrictions.
Quickstart
import pycron
# Check if current time matches a cron schedule
if pycron.is_now('*/5 * * * *'):
print('Runs every 5 minutes')
# Check if a specific datetime matches
from datetime import datetime
dt = datetime(2025, 6, 5, 12, 0)
if pycron.is_now('0 * * * *', dt):
print('Matches at minute 0 of every hour')
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode (last commit 2025-10-08 is recent, but status is 'aging').
- Performance characteristics when evaluating many schedules or with high-frequency calls.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 435 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,099,587/month — #3,296 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycron-3.2.0-py3-none-any.whl
Keywords: cron, parser
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
cron-converterParses cron schedule strings into structured…
permissive · top 5,000 on PyPI
cron-validatorValidates Unix cron expressions, matches them…
permissive · top 5,000 on PyPI
pyawscronParses and iterates over AWS CloudWatch cron…
permissive · top 15,000 on PyPI
crontabParses crontab schedule expressions and…
copyleft · top 5,000 on PyPI
cronitercroniter iterates over datetime objects using…
permissive · top 1,000 on PyPI
tzcronParse and iterate over cron/quartz schedule…
permissive · top 15,000 on PyPI
cronsimParses and evaluates cron expressions to find…
permissive · top 5,000 on PyPI
cronexEvaluates cron expressions to determine if a…
permissive · top 15,000 on PyPI
aws-croniterParses, validates, and calculates occurrences…
permissive · top 15,000 on PyPI
APSchedulerAPScheduler lets you schedule Python code to…
permissive · top 1,000 on PyPI