schedule
schedule
Planning and scheduling utilities for Snowflake stored procedures and DAGs.
Groups
Calendar French public-holiday calendar, business-day helpers (no external deps). Cron Human-readable cron formatting, next-schedule computation.
Optional dep for cron execution: croniter (pip install croniter).
business_days_between(start, end, country='FR')
Count business days in [start, end) -- start inclusive, end exclusive.
Source code in src/pinky_core/schedule.py
78 79 80 81 82 83 84 85 86 | |
cron_to_human(expr)
Return a human-readable description of a standard 5-field cron expression.
Format: minute hour dom month dow (Snowflake / POSIX convention).
Examples
"0 9 * * 1-5" -> "weekdays (Mon-Fri), at 09:00" "30 6 * * " -> "every day, at 06:30" "0 0 1 * " -> "on day 1 of every month, at 00:00"
Source code in src/pinky_core/schedule.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
is_business_day(d, country='FR')
Return True if d is a weekday and not a public holiday.
Source code in src/pinky_core/schedule.py
59 60 61 62 63 64 65 | |
is_in_schedule(expr, dt=None)
Return True if dt (defaults to now UTC, minute-truncated) matches the cron expression.
Requires: croniter -- pip install croniter
Source code in src/pinky_core/schedule.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
next_business_day(d, n=1, country='FR')
Return the n-th business day strictly after d.
Source code in src/pinky_core/schedule.py
68 69 70 71 72 73 74 75 | |
next_schedule(expr, from_dt=None)
Return the next scheduled datetime after from_dt (defaults to now UTC).
Requires: croniter -- pip install croniter
Source code in src/pinky_core/schedule.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
public_holidays_fr(year)
Return the set of French public holidays (metropole) for the given year.
Source code in src/pinky_core/schedule.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |