skillfed

pycron

Simple cron-like parser, which determines if current datetime matches conditions.

pycron v3.2.0 2.1M downloads/30d#3,296 on PyPI170
Permissive license MIT AGING released

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 pycron

uv

uv add pycron

poetry

poetry add pycron

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

cron schedule parsercron expression matchingcheck if time matches croncron datetime validatorcron-like schedulingparse cron strings python
schedulingcron-parserdatetime

More Utilities packages