Repository navigation
Releases: derek73/python-nameparser
Release list
v2.6.0
nameparser 2.6 ships the default vocabulary as per-word data files, adds an opt-in reading for names with two family names, and fixes words read as a credential or a title that are part of the name. Highlights:
- An opt-in reading for names with two family names.
Policy(two_family_names=True)readsGabriel García Márquezwith familyGarcía Márquez. (#754) - Surnames that are also credentials read as surnames.
Luo SiandMaria de Sagive familySiandde Sa, where 2.5 readSiandSaas credentials. (#791, #796, #857) - Wm and Md read as the given names they abbreviate.
Wm SmithandMr Md Karim Uddingive firstWmandMd, where 2.5 read both as titles. (#789, #853) - More credentials after a comma read as suffixes.
John Smith, MBChBgives suffixMBChB, where 2.5 gave firstMBChB, lastJohn Smith. (#797, #848)
One default is removed: sa is no longer a post-nominal acronym, so John Smith SA gives last SA. Add it back with Lexicon.default().add(suffix_acronyms={"sa"}). (#857)
A Lexicon, Policy or Parser pickled by an earlier release no longer loads; re-pickle after upgrading. ParsedName and HumanName pickles still load. (#754, #835)
Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html
v2.5.0
nameparser 2.5 reads more of the shapes real listings write. Highlights:
- Junior and senior in 45 languages.
Antonio Pavlović mlađigives suffixmlađi, where 2.4 read it as the last name. (#661, #679) - A title before a family comma is a title.
Dr. Smith, Johngives titleDr., lastSmith, where 2.4 gave lastDr. Smith. (#701) - A lone first name followed by V, I or X keeps its last name again.
Malcolm Xgives lastX, as 1.4.0 did. (#718, #721) - Chinese and Japanese credential and office words.
田中社長gives family田中, suffix社長, andlocales.ZHknows more surnames, compound ones included. (#671, #707, #695)
One default is removed: mai is no longer a post-nominal acronym, so Tran Thi Mai keeps its given name and John Smith MAI gives last MAI. Add it back with Lexicon.default().add(suffix_acronyms={"mai"}). (#687)
Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html
v2.4.2
nameparser 2.4.2 fixes two readings.
- Fix a name typed with decomposed (NFD) accents or hangul reading differently from its composed spelling.
John й Smithtyped withйasиplus a combining breve gives middleй, where 2.3.0 through 2.4.1 read the whole name as the first name, restoring 1.4.0's reading. (#665) - Fix the Hausa given name Shehu being read as a title.
Shehu Shagarigives firstShehu, lastShagari, where 1.4.0 through 2.4.1 gave titleShehuand no first name. (#660)
Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html
v2.4.1
nameparser 2.4.1 fixes two readings.
- Fix a decomposed (NFD) accented letter ending its word early.
Dr. inž. Janez Novakgives titleDr. inž.when thežis written aszplus a combining caron, where 1.4.0 and 2.0 through 2.4 madeinž.the given name. (#652) - Fix a comma inside a nickname being dropped.
Jane (Janey, Jo) Smithgives nicknameJaney, Jo, where 2.0 through 2.4 gaveJaney Jo, restoring 1.4.0's reading. (#653)
Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html
v2.4.0
nameparser 2.4 reads post-nominal credentials much more reliably, recognizes more naming conventions, and writes credentials the usual way when it repairs case.
- Capitals tell a credential from a surname.
Jack MAis Jack with an MA andJack Mais the surname Ma, where 2.3 read both as the surname. Credentials the word lists don't carry, such asLEED APandN.C.C., are read too. - Credentials after a name stay together.
Jane Smith, PhD MAgives suffixPhD MA, where 2.3 readPhDas her first name, andEric H. Holder Jr. Attorney Generalgives suffixJr.and titleAttorney General. - More naming conventions. The Catalan surname link (
Josep Carod i Rovira), the Irish particles (Liam Ó Murchú), salutations in Finnish, Icelandic, Malay and other languages (Herra Väinö Johansson), and Japanese names in halfwidth katakana (山田 タロウ). - Case repair writes credentials the usual way.
john smith phdcapitalizes toJohn Smith PhDandJANE DOE MBAtoJane Doe MBA. - More ambiguity reports, each naming the field its word ends up in.
- Python 3.15 support.
Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html
v2.3.0
Parsing fixes and new honorific vocabulary; nothing in the API is removed or renamed.
The fixes cluster around post-nominals and titles. A space-separated run of post-nominals keeps the spacing the writer typed (John Smith MD PhD → suffix MD PhD, not MD, PhD), and the acronyms that are also surnames — Rai, Cha, Ba — no longer take a name's family name. A run of titles addresses by its last, and a trailing abbreviated title reads as a title. CJK names and honorifics written with a full stop of any width now parse. The additions are renunciate and royal given-name titles, Devanagari and the first Bengali honorifics, and two AmbiguityKind members that report a reading nothing in the name decided.
Incompatibility: a Lexicon pickled by 2.1.x or 2.2.x with a caller-added entry written with a fullwidth or ideographic full stop, or in NFD, no longer loads (ValueError: incompatible Lexicon pickle: entries are not normalized). The shipped vocabulary is unaffected; rebuild the Lexicon from its source rather than unpickling it.
Full release notes: https://nameparser.readthedocs.io/en/latest/release_log.html
v2.2.0
A rename plus about thirty parsing fixes.
The nameparser.config word lists are renamed to match the Lexicon they feed — PREFIXES → PARTICLES, BOUND_FIRST_NAMES → BOUND_GIVEN_NAMES, FIRST_NAME_TITLES → GIVEN_NAME_TITLES, SUFFIX_NOT_ACRONYMS → SUFFIX_WORDS, and NON_FIRST_NAME_PREFIXES → NON_GIVEN_NAME_PARTICLES — and are now frozen. Every 1.x name still imports with a DeprecationWarning until 3.0. The rename itself changes no parse.
The fixes cluster around surname particles, largely what a declared name_order means for Latin-script names; then maiden-name clauses, Arabic bound given names, and credentials after a comma.
Breaking: TITLES.add("dean") now raises AttributeError. Build a private Constants (c = Constants(); c.titles.add("dean"); HumanName(name, constants=c)) or a Lexicon (Parser(lexicon=Lexicon.default().add(titles={"dean"}))) instead. See the migration guide.
Full release notes: https://nameparser.readthedocs.io/en/latest/release_log.html
2.1.0
nameparser 2.1 makes East Asian names work without configuration. Chinese, Japanese and Korean names written in their own scripts are read family-first, unspaced Korean names are split against the census surname list, and CJK honorifics are recognized whether they are spaced or written against the name.
The two conventions that need you to declare a language, Han segmentation and kana-aware division, ship as the opt-in locales.ZH and locales.JA packs.
Most of this is default-on, deliberately: wherever nameparser acts unasked, the script itself settles the convention and no language detection is involved. Only names bearing CJK characters parse differently from 2.0 — measured across 751 corpus names, with zero changes on Latin-only input.
Existing HumanName code keeps working through 2.x.
- East Asian names — how it fits together
- Customizing the parser — the switches that turn it off
- Full release notes
Please open an issue for anything that parses wrong.
v2.0.0
nameparser 2.0 — a new immutable core API, with full compatibility for existing code through 2.x.
parse() returns an immutable ParsedName whose seven fields are named for what they are (given, family) rather than where they sit in a Western name, configured by two frozen value objects — a Lexicon of vocabulary and a Policy of behavior — instead of a mutable global. Every parse can tell you what it had to guess at (ambiguities) and exactly where each token came from (tokens, with character spans).
HumanName keeps working. It is now a compatibility facade over the same pipeline and stays through 2.x — most 1.x code needs no changes. What 2.0 removes is the batch of deprecations announced in 1.3 and 1.4; if your suite runs clean on 1.4 under python -W error::DeprecationWarning, you are nearly done. One removal changes results silently rather than raising: name == "John Smith" is now False — use matches(). The migration guide has the field-by-field map.
Highlights:
- Seven named fields —
title,given,middle,family,suffix,nickname,maiden— plus derived views (family_particles,given_names, …),render(spec),initials(),capitalized(), and semantic comparison viamatches()/comparison_key() - Composable configuration — frozen
Lexicon+Policy, partialPolicyPatchdeltas,Policy.patched(), andParser.revise()for tag-preserving corrections - Family-first name order (
Policy(name_order=FAMILY_FIRST)) and opt-in locale packs (parser_for(locales.RU)) — never auto-detected - Non-Latin vocabulary in the default lexicon (Cyrillic, Greek, Arabic, Hebrew), typographic nickname delimiters, and maiden-name markers (
née,geb., …) - Python 3.11+, zero runtime dependencies, fully typed (PEP 561)
The full change list is in the release log; rc1/rc2 testers can read its "Changed since 2.0.0rc1" section. Please report anything the migration missed on #284.
🤖 Generated with Claude Code
v2.0.0rc2
Second release candidate for nameparser 2.0.0. Install it with pip install --pre nameparser (a plain pip install will not select a pre-release). Please report anything the migration missed on #284.
rc2 is rc1 plus the post-rc1 API-polish bundle (#290). If you tested rc1, the release log's "Changed since 2.0.0rc1" section lists exactly what you'd notice:
Rolebecame aStrEnum— members compare and stringify as their field namesParsedName.tokens_for()raisesValueErrorfor unknown roles instead of silently returning no tokens, and accepts role-name stringsParsedName.as_dict()'sinclude_emptyis keyword-onlyHumanNamesubscripting acceptsRolemembers- The eight multi-word vocabulary entries that could never match were repaired (
chargé d'affairessplit into chainable words, both spellings; seven credential acronyms removed), and storing a new multi-word entry now warns — a restored pre-2.0Constantspickle carrying all eight is cleaned up silently PolicyPatch's repr shows only the fields a patch sets- New API since rc1:
STABLE_TAGS,Policy.patched(),Parser.matches(),Parser.capitalized(), andParser.revise()
🤖 Generated with Claude Code