finds.dev← search

// the find

kennethreitz/maya

★ 3,413 · Python · MIT · updated Jul 2024

Datetimes for Humans™

Maya is a Python datetime library that normalizes everything to UTC epoch internally and exposes a human-friendly API for parsing, formatting, and timezone conversion. It sits in the same space as Arrow and Pendulum, but was specifically built around web scraping use cases where you're ingesting messy datetime strings from arbitrary sites. kennethreitz started it; timofurrer has been maintaining it since.

The epoch-first internal representation means timezone arithmetic is genuinely correct — no DST surprises because there's no local time under the hood. The `snap` and `snap_tz` modifiers for rounding to calendar boundaries are a nice touch that Arrow and Pendulum handle more awkwardly. Parsing via `maya.when()` handles human strings like 'tomorrow' and '3 hours ago' alongside ISO 8601 and RFC 2822 in one call, which is handy for scraping. `MayaInterval` gives you proper calendar event semantics (overlap, gap, union) without rolling your own.

3,400 stars and the last commit was mid-2024 — it's not dead but it's not active either, and the issue tracker has open bugs that haven't moved in years. It depends on Pendulum for parsing, which adds a non-trivial dependency that has its own breaking changes to manage. Pre-1970 dates are technically supported via negative epochs but the test coverage for that is thin and edge cases around DST transitions in old timezone data can silently produce wrong results. At this point Python's own `zoneinfo` (3.9+) plus `datetime` handles most of what Maya was built for, so the 'why use this over stdlib' answer is getting harder to make.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →