Skip to content

Releases: derek73/python-nameparser

v2.6.0

Choose a tag to compare

@derek73 derek73 released this 25 Oct 08:21
53a65db

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) reads Gabriel García Márquez with family García Márquez. (#754)
  • Surnames that are also credentials read as surnames. Luo Si and Maria de Sa give family Si and de Sa, where 2.5 read Si and Sa as credentials. (#791, #796, #857)
  • Wm and Md read as the given names they abbreviate. Wm Smith and Mr Md Karim Uddin give first Wm and Md, where 2.5 read both as titles. (#789, #853)
  • More credentials after a comma read as suffixes. John Smith, MBChB gives suffix MBChB, where 2.5 gave first MBChB, last John 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

Choose a tag to compare

@derek73 derek73 released this 19 Oct 08:38
2915693

nameparser 2.5 reads more of the shapes real listings write. Highlights:

  • Junior and senior in 45 languages. Antonio Pavlović mlađi gives suffix mlađi, where 2.4 read it as the last name. (#661, #679)
  • A title before a family comma is a title. Dr. Smith, John gives title Dr., last Smith, where 2.4 gave last Dr. Smith. (#701)
  • A lone first name followed by V, I or X keeps its last name again. Malcolm X gives last X, as 1.4.0 did. (#718, #721)
  • Chinese and Japanese credential and office words. 田中社長 gives family 田中, suffix 社長, and locales.ZH knows 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

Choose a tag to compare

@derek73 derek73 released this 14 Oct 04:16
a7bb3a8

nameparser 2.4.2 fixes two readings.

  • Fix a name typed with decomposed (NFD) accents or hangul reading differently from its composed spelling. John й Smith typed 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 Shagari gives first Shehu, last Shagari, where 1.4.0 through 2.4.1 gave title Shehu and no first name. (#660)

Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html

v2.4.1

Choose a tag to compare

@derek73 derek73 released this 13 Oct 07:51
cd51a4c

nameparser 2.4.1 fixes two readings.

  • Fix a decomposed (NFD) accented letter ending its word early. Dr. inž. Janez Novak gives title Dr. inž. when the ž is written as z plus a combining caron, where 1.4.0 and 2.0 through 2.4 made inž. the given name. (#652)
  • Fix a comma inside a nickname being dropped. Jane (Janey, Jo) Smith gives nickname Janey, Jo, where 2.0 through 2.4 gave Janey Jo, restoring 1.4.0's reading. (#653)

Full list of changes: https://nameparser.readthedocs.io/en/latest/release_log.html

v2.4.0

Choose a tag to compare

@derek73 derek73 released this 11 Oct 22:34
b0a39a4

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 MA is Jack with an MA and Jack Ma is the surname Ma, where 2.3 read both as the surname. Credentials the word lists don't carry, such as LEED AP and N.C.C., are read too.
  • Credentials after a name stay together. Jane Smith, PhD MA gives suffix PhD MA, where 2.3 read PhD as her first name, and Eric H. Holder Jr. Attorney General gives suffix Jr. and title Attorney 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 phd capitalizes to John Smith PhD and JANE DOE MBA to Jane 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

Choose a tag to compare

@derek73 derek73 released this 12 Sep 20:07
1c89e2e

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

Choose a tag to compare

@derek73 derek73 released this 01 Sep 04:51
e52aeaa

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

Choose a tag to compare

@derek73 derek73 released this 07 Aug 07:30
49c381d

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.

Please open an issue for anything that parses wrong.

v2.0.0

Choose a tag to compare

@derek73 derek73 released this 28 Jul 05:46
1484006

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 via matches()/comparison_key()
  • Composable configuration — frozen Lexicon + Policy, partial PolicyPatch deltas, Policy.patched(), and Parser.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

v2.0.0rc2 Pre-release
Pre-release

Choose a tag to compare

@derek73 derek73 released this 26 Jul 20:41
25b095b

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:

  • Role became a StrEnum — members compare and stringify as their field names
  • ParsedName.tokens_for() raises ValueError for unknown roles instead of silently returning no tokens, and accepts role-name strings
  • ParsedName.as_dict()'s include_empty is keyword-only
  • HumanName subscripting accepts Role members
  • The eight multi-word vocabulary entries that could never match were repaired (chargé d'affaires split into chainable words, both spellings; seven credential acronyms removed), and storing a new multi-word entry now warns — a restored pre-2.0 Constants pickle 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(), and Parser.revise()

🤖 Generated with Claude Code