Skip to main content

Get next and previous runs for a standard 5-field cron expression as normalized timestamps.

Project description

cron-runs for Python

Get the next and previous runs for a standard 5-field cron expression as normalized timestamps.

Install

pip install cron-runs

Features

  • Standard 5-field cron only
  • Timezone-aware output
  • Reference time support
  • ISO UTC, ISO with timezone offset, Unix seconds, Unix milliseconds
  • Human-readable cron description

Usage

from cron_runs import get_cron_runs

result = get_cron_runs(
    cron='0 9 * * 1-5',
    timezone='America/Los_Angeles',
    reference_time='2026-04-14T10:30:00-07:00',
    next=2,
    prev=1,
)

print(result)

API

get_cron_runs(...)

Inputs

  • cron str, required
  • timezone str, optional, default UTC
  • reference_time str or int or float, optional, default now
  • next int, optional, default 1
  • prev int, optional, default 1

Notes

  • reference_time accepts:
    • ISO UTC
    • ISO with timezone offset
    • Unix seconds
    • Unix milliseconds
  • next and prev can be 0 through 100
  • This package does not schedule jobs. It only calculates occurrences.

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

cron_runs-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

cron_runs-1.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file cron_runs-1.0.0.tar.gz.

File metadata

  • Download URL: cron_runs-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for cron_runs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 011d8c205f59fe4b3ae4f28488accd4f11b7a671ad67b4b3f1690011c28f3be5
MD5 e4959aab45c426cac78a016a5f0a17cb
BLAKE2b-256 fe84c3d6ebd78eec1565199b1560283ac0f4e6b8aaec1cd1e34d3165ff86ee64

See more details on using hashes here.

File details

Details for the file cron_runs-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cron_runs-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for cron_runs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cbd39fc1c99443b2da5da1b6a41f8fbe4d855075f8408d8b364ce868e6531b2
MD5 d3b7ff024ea9c8b56a722001a613a8d3
BLAKE2b-256 10e6d93842d3936cb846de864e016dc19e85949fe6dc41c1450dcb923fec9fa7

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