Expand description
Time-bucket conversions for analytics.
Converts between integer day_id / hour_id keys (as stored in SQLite rollup tables) and human-readable ISO date strings used in JSON output.
Functionsยง
- day_
id_ to_ iso - Format a
day_idas an ISO date string (YYYY-MM-DD). - day_
id_ to_ iso_ week - Compute the ISO week key (
YYYY-Www) from aday_id. - day_
id_ to_ month - Compute the month key (
YYYY-MM) from aday_id. - hour_
id_ to_ iso - Format an
hour_idas an ISO datetime string (YYYY-MM-DDTHH:00Z). - resolve_
day_ range - Resolve the time-range from
AnalyticsFilterinto an inclusive(min_day_id, max_day_id)range. Returns(None, None)when no time filter is active. - resolve_
hour_ range - Resolve the time-range from
AnalyticsFilterinto an inclusive(min_hour_id, max_hour_id)range.