Metadata-Version: 2.4
Name: cron-runs
Version: 1.0.0
Summary: Get next and previous runs for a standard 5-field cron expression as normalized timestamps.
Project-URL: Homepage, https://github.com/troytessalone/cron-runs
Project-URL: Repository, https://github.com/troytessalone/cron-runs
Project-URL: Issues, https://github.com/troytessalone/cron-runs/issues
Author: Troy Tessalone
License: MIT
Keywords: cron,iso,occurrences,schedule,timestamps,timezone,unix
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: cron-descriptor>=1.4.5
Requires-Dist: croniter>=3.0.3
Description-Content-Type: text/markdown

# cron-runs for Python

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

## Install

```bash
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

```python
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.
