Skip to main content

Translate between human-readable schedules and cron expressions

Project description

cronspeak

Translate between human-readable schedules and cron expressions. Both directions.

pip install cronspeak

Usage

Human → Cron

$ cronspeak to-cron "every 5 minutes"
*/5 * * * *

$ cronspeak to-cron "every day at 3pm"
0 15 * * *

$ cronspeak to-cron "every monday at 9am"
0 9 * * 1

$ cronspeak to-cron "every weekday at 8:30am"
30 8 * * 1-5

Cron → Human

$ cronspeak explain "*/5 * * * *"
Every 5 minutes

$ cronspeak explain "0 15 * * *"
Every day at 3:00 PM

$ cronspeak explain "30 8 * * 1-5"
Every weekday at 8:30 AM

Next Run Times

$ cronspeak next "*/15 * * * *"
Schedule: Every 15 minutes

Next 5 runs:
  2026-02-03 00:15:00 (Tuesday)
  2026-02-03 00:30:00 (Tuesday)
  2026-02-03 00:45:00 (Tuesday)
  2026-02-03 01:00:00 (Tuesday)
  2026-02-03 01:15:00 (Tuesday)

JSON Output

All commands support --json for machine-readable output:

$ cronspeak to-cron "every tuesday at 3pm" --json --show-next 3
{
  "input": "every tuesday at 3pm",
  "cron": "0 15 * * 2",
  "explanation": "Every Tuesday at 3:00 PM",
  "next_runs": [
    "2026-02-03T15:00:00",
    "2026-02-10T15:00:00",
    "2026-02-17T15:00:00"
  ]
}

Interactive Mode

$ cronspeak interactive
Cronspeak interactive mode
Enter a schedule ('every 5 minutes') or cron expression ('*/5 * * * *')
Type 'quit' to exit

> every hour
   0 * * * *
  Next: 2026-02-03 01:00

> 0 9 * * 1-5
   Every weekday at 9:00 AM
  Next: 2026-02-03 09:00

Supported Patterns

Human Input

Pattern Example Cron
Every N minutes every 5 minutes */5 * * * *
Every hour every hour 0 * * * *
Every N hours every 2 hours 0 */2 * * *
Every day at time every day at 3pm 0 15 * * *
At time at 9:30am 30 9 * * *
Every weekday every monday 0 0 * * 1
Weekday at time every friday at 5pm 0 17 * * 5
Weekdays every weekday at 9am 0 9 * * 1-5
Weekends every weekend at 10am 0 10 * * 0,6
Monthly every month on the 1st 0 0 1 * *
Shortcuts noon, midnight 0 12 * * *, 0 0 * * *

Cron Input

Standard 5-field cron expressions are supported:

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *

Python API

from cronspeak import parse_human, explain_cron, get_next_runs

# Human → Cron
expr = parse_human("every day at 3pm")
print(expr)  # "0 15 * * *"

# Cron → Human
explanation = explain_cron("0 15 * * *")
print(explanation)  # "Every day at 3:00 PM"

# Next runs
from datetime import datetime
runs = get_next_runs("*/5 * * * *", count=3)
for run in runs:
    print(run)

For AI Agents

See SKILL.md for agent-optimized documentation with command patterns and JSON output specs.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cronspeak-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cronspeak-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file cronspeak-0.1.0.tar.gz.

File metadata

  • Download URL: cronspeak-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cronspeak-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9db1b45bcc99b3e6a8ac5ef1c76160fd47957b17f1f7b3a8c2ad3a584f3da289
MD5 51c05171403faf434ec6fbfa3723ec9c
BLAKE2b-256 7e022fae7d890d68104470c2c9249a197dce3b477cc90b05d1bf238bad84e404

See more details on using hashes here.

File details

Details for the file cronspeak-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cronspeak-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cronspeak-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24e6db9e780cb6b88b8268e5e1b401abd937fb4569d0d442b48dfc0172108d0d
MD5 e8f329a96d4fb95fee2ba1151d28eaac
BLAKE2b-256 fe742ef38da81256d7727eb4aabe4512b1f8ed86df3ef0e0e4c2122cec38cd61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page