Date-of-birth / age-threshold utility with timezone-correct date math. Answer whether someone meets a jurisdiction minimum age using the calendar date in that jurisdiction's timezone.
pip install agecheckfrom datetime import date
from agecheck import is_of_age, age_on
dob = date(2000, 6, 15)
assert is_of_age(dob, 18, on=date(2018, 6, 15), tz="UTC") is True
assert is_of_age(dob, 18, on=date(2018, 6, 14), tz="UTC") is False
assert age_on(dob, on=date(2026, 6, 15), tz="UTC") == 26- Birthday boundaries must respect jurisdiction local date, not server UTC alone
- UTC works with the stdlib; IANA zones optional via
tzdata - Simple
is_of_age/age_onAPI for compliance checks
| Symbol | Description |
|---|---|
is_of_age(dob, minimum, *, on, tz) |
True if age meets minimum |
age_on(dob, on=None, *, tz) |
Whole years of age on a date |
Part of the coldbricks micro-library suite (small, typed, zero-dependency helpers):
| Package | Role |
|---|---|
buzzkill |
Guaranteed shutdown callbacks |
aftercare |
Reverse-order teardown |
fluffer |
Startup pre-warm |
edging |
Token-bucket rate limit |
readback |
Echo-confirmation validation |
hearback |
Output re-validation decorator |
| agecheck | Timezone-correct age thresholds |
transponder |
State broadcast on change |
pip install -e ".[dev]"
pytest -q
ruff check .
mypy srcThis is an early 0.1.0 release (Alpha) with active development planned:
- Jurisdiction preset table (US states, EU defaults)
- Optional document-level verification helpers
- Stricter input parsing modes
MIT © Coldbricks — coldbricks@gmail.com