Skip to content

docs: add Coming-from-Python section + fix stale counts - #1

Merged
conorbronsdon merged 1 commit into
mainfrom
docs/python-onramp-and-accuracy
Jul 6, 2026
Merged

docs: add Coming-from-Python section + fix stale counts#1
conorbronsdon merged 1 commit into
mainfrom
docs/python-onramp-and-accuracy

Conversation

@conorbronsdon

Copy link
Copy Markdown
Owner

Summary

Two documentation changes:

  1. Coming from Python — a short side-by-side section (near the top, after
    the intro) mapping the familiar Python API to this library's real API.
    Every snippet was extracted from this repo's own examples/ and test/;
    nothing was invented.
  2. Accuracy fixes — Suite copy Ten -> Eleven and added mojo-xml link. Test count re-verified by counting: 29 (matches README).

Test counts were re-verified by actually counting the test functions in the
repo (not trusting the prior text).

From an automated review (personal-context#62); drafted by Claude Code — please review the Coming-from-Python snippets for API accuracy.

Adds a "Coming from Python" on-ramp table (verified against the repo's own
examples/ and tests) and corrects suite/test-count accuracy issues.

Co-Authored-By: Claude <noreply@anthropic.com>
@conorbronsdon

Copy link
Copy Markdown
Owner Author

🤖 Independent Claude review: Ready.

Verified every Mojo snippet in the new "Coming from Python" section against src/captions/captions.mojo and src/captions/model.mojo — all 7 API references are real, no invented APIs:

  • parse_captions(source), to_srt(caps), to_vtt(caps), plain_text(caps), duration_ms(caps) — all exported from __init__.mojo and defined in captions.mojo.
  • cues_between(caps, start_ms, end_ms) — signature matches exactly (cues_between(captions, start_ms, end_ms)).
  • caps.cues and cue.text / cue.start_ms / cue.end_ms — real fields on Captions / Cue in model.mojo.

Python side (webvtt-py): webvtt.read(), caption iteration with .text, .start/.end, and save_as_srt() are all correct/idiomatic.

Count: "Eleven pure-Mojo libraries" checks out — 10 sibling libs listed + mojo-captions itself (unlisted, as before), consistent with the prior "Ten". mojo-xml cross-link added correctly.

No blocking issues.

@conorbronsdon
conorbronsdon marked this pull request as ready for review July 6, 2026 07:58
@conorbronsdon

Copy link
Copy Markdown
Owner Author

Docs review (sonnet): SHIP

webvtt-py-comparison table verified — parse_captions, to_srt, to_vtt, plain_text, cues_between, duration_ms all real exports; Cue fields (index, start_ms, end_ms, speaker, text) match model.mojo:16-22. Correctly notes there's no Python stdlib equivalent (scopes to webvtt-py) rather than implying parity. 29-test count exact. Ship.

@conorbronsdon
conorbronsdon merged commit 8e33929 into main Jul 6, 2026
1 check passed
@conorbronsdon
conorbronsdon deleted the docs/python-onramp-and-accuracy branch July 6, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant