Skip to content

Add a getting-started page, and lead README and the docs index with it - #1353

Merged
derek73 merged 5 commits into
masterfrom
claude/docs-getting-started-and-readme-c4cb82
Nov 12, 2026
Merged

derek73 merged 5 commits into
masterfrom
claude/docs-getting-started-and-readme-c4cb82

Conversation

@derek73

@derek73 derek73 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

The second of the two PRs restructuring the user docs (the first, #1343, moved text only). This one writes the entry path: a getting-started page, the README and index leads that point to it, and the rewrites #1343 left for it.

Pages

Page Before (wc -w) After Plan target What changed
getting-started (new) — 1,344 (about 200 of them doctest output and table markup) 1,100–1,300 Parse one name; a list of names with suggest (what it decides, choosing a language pack first, where it declines); matching (keys, check, each source parsed with its own parser); a task table linking the nine pages. First in the toctree, under "Start here".
index 173 209 — The three steps as links (getting-started, suggest, matching); "Start here" toctree caption; the sphinx-quickstart comment dropped.
usage 3,440 3,481 3,000 Retitled "Working with a parsed name" with a lead pointing to getting-started; the two passages duplicated in customize cut to the report (below), with two report doctests added (Jack Ma, John Smith KC); "Where next" rewritten for the new pages.
shapes 2,909 2,911 2,800 The cross-page "under East Asian names below" fixed.
customize 5,332 5,499 5,000 Intro gives the order to try things in: suggest, a pack, a Policy field, a Lexicon edit. Absorbs one doctest from usage.
locales 5,958 5,155 4,900 "East Asian names need no pack" cut to a pointer; "Contributing a pack to nameparser" moved out; one doctest added (below).
contributing 25 739 735 Gains "Contributing a pack to nameparser" verbatim, with a contributing-a-pack label.
east-asian, matching, languages 4,180 / 2,770 / 2,360 unchanged 3,800 / 2,700 / 2,300 Not tightened here: nothing in them was stale against master, and cutting toward the targets would mean dropping behavior statements this PR has no reason to drop.
README.rst 1,899 1,789 — Leads with 3.1 (suggest, matching) and the three getting-started steps; keeps the one-liner block; the Spanish, Vietnamese and strict-choice tour replaced by one sentence linking locales and languages; "Learn more" lists the new pages.

suggest's claims on getting-started were checked against nameparser/_suggest.py and Parser.suggest's docstring: it decides name_order, patronymic_rules and initials_as_family, never a language, and keeps every other setting at the base's value. No accuracy figure is quoted on the page; it points to suggest.rst, which holds the measured table.

Removed doctests and claims

Doctests (>>> statements):

  • usage.rst "Credentials that are also surnames": parse("Jack MA").suffix and parse("Jack Ma").family. Duplicated in customize.rst's section of the same title, which keeps both.
  • usage.rst same section: parse("John Smith Ma").family. Moved to customize.rst's doctest beside the other two, where the prose already stated it.
  • usage.rst "Titles that are also given names": parse("Dean of Students Jane Smith").title. Duplicated in customize.rst's titles-also-given-names doctest; usage keeps the phrase in prose and the title-or-name report.
  • README.rst tour, each still shown elsewhere:
    • ES's two family names, surname1/surname2/generation and render on Juan Carlos García de la Vega: usage's surname1/surname2 doctests and languages.rst.
    • two_given_names reading Juan Carlos: policy.rst's two-given-names doctests.
    • Lady Heidenreich title by default, given under ES: locales.rst's doctest.
    • ES Lady Justice Jane Smith keeps the title: was prose only in locales.rst; added there as a doctest in this PR.
    • Strict ES reading Lady Justice Jane Smith with no title: not shown elsewhere with that name; locales.rst's strict-choice section shows a strict choice dropping English words with its own examples.
    • FAMILY_FIRST_GIVEN_LAST chaining Van Anh, and VI keeping Van a middle name: locales.rst and languages.rst (Nguyen Van Anh).

Claims (prose):

  • usage's three-bullet summary of how a bare credential-or-surname is read (capitals, other cased spellings, the count "not counting a title or a nickname"): condensed to one sentence; the full rules stay in customize.rst's "Credentials that are also surnames", which already held them in more detail.
  • locales' "East Asian names need no pack" detail (kanji with kana other than katakana alone; Korean surnames a closed census set shipped as default vocabulary; a Chinese surname list splitting Japanese names wrongly): cut to a pointer; east-asian.rst states each.
  • usage's opening line (Python 3.11+, pip install nameparser): now on getting-started.
  • usage's "Where next" lost its concepts, locales and migrate lines and "HumanName, which 3.0 removes"; getting-started's table and index.rst carry both links, and migrate.rst the fact.
  • README's 3.0 announcement detail (Lexicon configured by reading, a name rendered in the order written, packs that choose languages): the release log's 3.0 entry holds each. Its list of what 3.0 removed (Constants, CONSTANTS, nameparser.util, the 1.x names of the word lists) and "2.8 is the last release that has them, and it warns at each use": README's "Coming from 1.x or 2.x" keeps Constants, CONSTANTS and the 2.8.2 warning; nameparser.util and the word-list names are in migrate.rst.
  • The suggest example name: getting-started and README use Smith Mary / Mary Smith instead of the earlier example name, with the outputs re-run (the vote counts and the report are the same).

From #1343's "For the rewrite PR" list and the plan

Done: getting-started and its toctree entry; index.rst's lead links; README's 3.1 lead, quick start and East Asian link (now east-asian.html; usage.html#east-asian-names still resolves for released READMEs); both merges; the East Asian pointer; usage's "Where next" and retitle; customize's intro; "Contributing a pack" moved to contributing.rst; shapes.rst's "below".

Not done, and why:

  • east-asian, matching, languages toward their targets: see the table.

  • policy.rst's "see Vocabulary: Lexicon above" (policy.rst:667): policy.rst is being edited by another session this cycle. Reported to the coordinator.

Found outside this PR's files (not changed here)

  • Parser.suggest turns initials_as_family on under a middle_as_family base, where its docstring (nameparser/_parser.py, "nor turns it on under a base reading names family first or folding every middle into the family") and docs/suggest.rst say it does not: Parser(policy=Policy(middle_as_family=True)).suggest(["Ram Bahadur B K", "Sita Kumari B K", "Hari K C", "Gita Devi B K"]).patch is PolicyPatch(initials_as_family=True), inert there. getting-started states what the code does (given-first base only).
  • The earlier example name is still in docs/suggest.rst, docs/release_log.rst, the TypeError message in nameparser/_suggest.py (~line 1046, offered as code to paste) and the suggest tests.
  • parse("金 민준") (mixed Han and Hangul) reads given 金, family 준: an odd reading the docs' "wholly in Han or Hangul" correctly leaves out, possibly worth an issue.
  • Release-log :doc: links to labels: the release log is out of this PR's scope.
  • Pointer placement in usage.rst: kept at the end of "Parse a name"; it reads fine there and the anchor stays on usage.html.

Anchors

New: getting-started (label and page), contributing-a-pack. Moved: "Contributing a pack to nameparser" from locales.html to contributing.html (its one in-page link is now a :ref:); usage's page-title anchor is now working-with-a-parsed-name. git grep for using-the-parser, Using the parser, contributing-a-pack, Contributing a pack and need no pack across docs/, README.rst, nameparser/, tests/, tools/ and every AGENTS.md finds no other reference (dated decisions entries excepted, as history). Root AGENTS.md's release-checklist docs line and docs/AGENTS.md's page list name getting-started.rst.

Proof

  • uv run sphinx-build -b doctest docs <dir>: 822 tests, 0 failures (origin/master at 670b349: 788, 0 failures).
  • uv run sphinx-build -W -b html docs <dir>: exits 0, prints nothing.
  • README: python -m doctest README.rst passes; uv run --with readme_renderer python -m readme_renderer README.rst renders; every readthedocs.io/en/latest/<page>[#anchor] link in README resolves in the built HTML, and usage.html still holds id="east-asian-names" once.
  • Re-run on the final commit: uv run pytest: 45,962 passed, 38 skipped, 3 xfailed; uv run pytest -n0 -m serial: 35 passed; uv run mypy: no issues; uv run ruff check: clean. tests/v2/test_es_given_names.py, test_doc_citations.py and test_doc_spellings.py pass.

Reviews

  1. Docs review (fresh agent in its own worktree: ran every example, checked suggest/matching claims against the code, diffed removed sentences, read getting-started as a new user with a CSV). Found: usage's merged sentence said a Title-case Jack Ma reports nothing (it reports suffix-or-name); locales' and README's family-first sentence dropped the katakana-alone exception; "consistent" defined wider than check (opt-in outcomes, a name with no family); "a common given name" overstated (John casts no vote); the trailing-initial share's denominator; three omissions from the removed list; new-user gaps (no as_dict, suggest reads its iterable once, what to do with the disagreeing names, a one-word name matching nothing). All fixed.
  2. Comment analysis (pr-review-toolkit) on the prose stating thresholds: the three shares stated against the wrong denominators (order, patronymic, trailing initials), the katakana claim, the initials_as_family bullet with no numbers, "the one optional extra" as a standing count. All fixed; thresholds confirmed equal to the tested constants in _suggest.py.
  3. Review of the fix commit (fresh agent): the fix's initials_as_family condition followed the docstring, not the code (above); a comma name with only post-nominals does count toward the trailing-initial share; "two votes" should be two names; the disagreeing names may be misread, not are; usage's new "capitals settle it" is false of credentials written as words (KC, PC, DL); "and nothing else" (no dependencies) lost. All fixed in the last commit, each checked by running it.

🤖 Generated with Claude Code

derek73 and others added 3 commits November 12, 2026 10:50
Add docs/getting-started.rst: parse one name, let Parser.suggest()
choose the settings for a list (choosing a language pack first where the
list's language is known, and where it declines), and compare names with
Parser.matching(), then a table of tasks linking the nine pages.

README leads with the 3.1 features and the same three steps, keeps the
one-liner block, and points to the pack pages instead of the Spanish,
Vietnamese and strict-choice tour; its East Asian link points at
east-asian.html. index.rst links the three steps and puts
getting-started first under Start here.

The rewrites PR #1343 left: usage.rst retitled "Working with a parsed
name" with a new lead and Where next; its two passages duplicated in
customize.rst cut to the report, the rules left in customize; customize's
intro gives the order to try things in; locales' "East Asian names need
no pack" cut to a pointer; "Contributing a pack to nameparser" moved to
contributing.rst; shapes.rst's cross-page "below" fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eading README taught in a locales doctest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.1 milestone Nov 12, 2026
@derek73 derek73 added the docs Documentation fixes and updates label Nov 12, 2026
@derek73 derek73 self-assigned this Nov 12, 2026
derek73 and others added 2 commits November 12, 2026 10:58
- usage: a Title-case surname-or-credential (Jack Ma) reports
  suffix-or-name; only capitals and periods settle it silently. Doctest
  added. customize's parenthetical names the Title-case lean too.
- locales, README: a name only in katakana keeps the default order.
- getting-started: suggest's shares stated against the names they count
  (order: names whose order votes agree; patronymic: names that cast any
  vote; trailing initials: names left after commas and titles-only); the
  given-name evidence is names rarely surnames (Mary, not John);
  initials_as_family only on a given-first base keeping middles apart;
  consistent defined by the accepted outcomes, with the opt-in ones and a
  name with no family name; as_dict shown; pass a list, not a reader;
  suggestion.base for the disagreeing names; set the order yourself
  wherever you know it. Trimmed back to its word target.
- README: the report covers every setting considered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…indings

- getting-started and README: Smith Mary / Mary Smith in place of the
  earlier example name, which may be a real person's; outputs re-run.
- getting-started: an order needs two NAMES voting for it; the
  trailing-initial count is of initials nothing else in the name
  contradicts, and a name with only post-nominals after its comma counts;
  initials_as_family conditioned on a given-first base only (the code
  decides it under middle_as_family too); the disagreeing names MAY be
  misread; Python 3.11 and no other package restored.
- usage: capitals settle an acronym such as MA, not a credential written
  as a word (KC, PC, DL), which the count decides and reports; doctest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 2b39f23 into master Nov 12, 2026
14 checks passed
@derek73
derek73 deleted the claude/docs-getting-started-and-readme-c4cb82 branch November 12, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation fixes and updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant