From 89e59debfa3cdc51527e4639701362be7c219446 Mon Sep 17 00:00:00 2001 From: Conor Bronsdon <120674402+conorbronsdon@users.noreply.github.com> Date: Sun, 5 Jul 2026 23:05:50 -0700 Subject: [PATCH] docs: add Coming-from-Python section + fix stale counts 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 --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd6e7a7..0cf62fd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,21 @@ canonicalizing identifiers all break subtly when `"café"` (composed) and `"café"` (decomposed) are treated as different strings. This library makes them equal. +### Coming from Python + +If you know Python's `unicodedata`, the normalization entry points map directly: + +| Python | mojo-unicodedata | +| --------------------------------------- | ------------------------------ | +| `unicodedata.normalize("NFC", s)` | `normalize("NFC", s)` | +| `unicodedata.normalize("NFKD", s)` | `normalize("NFKD", s)` | +| `unicodedata.is_normalized("NFC", s)` | `is_normalized("NFC", s)` | +| `s.casefold()` | `casefold(s)` | + +These are module-level functions. If you normalize many strings, construct a +`Normalizer()` once and call `.normalize(form, s)` / `.casefold(s)` on it to +reuse the loaded tables. + ## What it handles - **All four normalization forms**: `normalize("NFC"|"NFD"|"NFKC"|"NFKD", s)`, @@ -155,9 +170,11 @@ described above. ## Part of a pure-Mojo library suite -Ten pure-Mojo libraries that mirror familiar Python stdlib and PyPI APIs, +Eleven pure-Mojo libraries that mirror familiar Python stdlib and PyPI APIs, filling gaps in the native Mojo ecosystem: +- [mojo-xml](https://github.com/conorbronsdon/mojo-xml) — general-purpose XML + parsing, an ElementTree-shaped DOM (Python's `xml.etree.ElementTree`) - [mojo-feed](https://github.com/conorbronsdon/mojo-feed) — RSS, Atom, and JSON Feed parsing (Python's `feedparser`) - [mojo-captions](https://github.com/conorbronsdon/mojo-captions) — SRT and