
Date Trail — Build a timeline from notes
Paste plain-text notes and get dated lines in order, uncertain dates marked, gaps above a chosen number of days, and a list of undated lines. #Writing
Paste plain-text notes. Get dated lines in order, uncertain dates marked, gaps above a chosen number of days, and a list of undated lines.
Date Trail recognizes ISO dates, year-first slash dates, unambiguous day/month/year dates, English month names, and Japanese month/day dates. It does not guess a missing year or resolve ambiguous numeric dates. It does not decide whether one event caused another.
What you can do
- Read ISO dates:
2026-11-20 - Read slash dates:
2026/11/20or20/11/2026when order is clear - Read written dates:
Nov 20, 2026or11月20日 - Choose the gap threshold:
--gap-days 14(allowed range: 1–365000) - Save a report:
--output report.md - Keep uncertain dates visible: Ambiguous numeric dates and dates without a year are marked, never silently assigned a year
- Check relationship notes:
--review-jsonaccepts a human-written observation only when both quotes exactly match source lines
Run
Requires Python 3.9 or newer. No third-party packages are needed.
python3 scripts/date_trail.py examples/notes.txt --gap-days 14 --review-json examples/review.json
The output below is the captured output for that command:
# Date Trail
## Dated lines in order
- 2026-11-03 — line 2: 2026-11-03: Kickoff notes shared.
- 2026-11-20 — line 1: 2026-11-20: The review moved to next week.
- Nov 22 (year missing) — line 3: Nov 22: Follow-up planned.
## Gaps of at least 14 days
- 2026-11-03 → 2026-11-20: 17 days
## Lines without a date
- line 4: Ask Maya to send the agenda.
## Human review
- Observation: The review change may be related to the kickoff timing; the notes do not explain why.
- Earlier line: 2026-11-03: Kickoff notes shared.
- Later line: 2026-11-20: The review moved to next week.
The human review section is a prompt for a language model or reviewer. With --review-json, the tool checks that each observation's two quotations exactly match separate source lines. It does not validate whether an interpretation is sound, so observations must remain cautious and must not claim a cause as fact.
Inputs and limits
- Input must be a non-empty UTF-8 or UTF-16 text file.
- Date-free lines remain in the report; uncertain dates are not used to calculate ordering or gaps.
- The earliest date token on each line is used.
- Markdown and CSV-looking text are treated as plain text. Named files are never opened or changed.
- Invalid files, unsupported encodings, invalid gap values, and unwritable output paths return a one-line
error:message and exit code 2.
Tests
Run python3 -m unittest discover tests. The suite uses only the Python standard library.
License
MIT.


