Skip to main content

Reference

Contract reminders​

  • parse_minutes(text): blank gives an empty list; otherwise parse every comma-separated field as integer minutes in 1..240. Empty fields and invalid values raise ValueError.
  • summarize(sessions): validated input; return count, total and longest without mutation. All three values are zero for an empty list.
  • save_sessions(path, sessions): write a validated list as UTF-8 JSON.
  • load_sessions(path): missing gives an empty list; invalid JSON or invalid values raise; other filesystem errors propagate.

A missing file and a corrupt file are different states. Duplicate durations remain separate sessions. See resources for official documentation; no book purchase or extracted book text is required.