Skip to content

Releases: derek73/python-nameparser

v1.4.0

Choose a tag to compare

@derek73 derek73 released this 12 Jul 19:32
ac37e57
  • Add Constants.copy(), a detached deep copy that preserves the source instance's current customizations (unlike Constants(), which always starts from library defaults) -- useful as CONSTANTS.copy() for a private snapshot of the shared config (#260)
  • Deprecate passing constants=None to HumanName (or assigning hn.C = None): it silently builds a fresh Constants(), discarding any customizations the caller may have expected to carry over from the shared CONSTANTS. Emits DeprecationWarning; will raise TypeError in 2.0. Use constants=Constants() for fresh library defaults or constants=CONSTANTS.copy() for a private snapshot instead (closes #260)
  • Deprecate assigning Constants.empty_attribute_default for removal in 2.0 (#255): once None support goes, the only legal value left is the default '', so a dial with one position isn't configuration. Emits DeprecationWarning; reading the attribute is unaffected
  • Deprecate unknown-key attribute access on TupleManager/RegexTupleManager (CONSTANTS.regexes.typo, CONSTANTS.capitalization_exceptions.typo, etc.) for removal in 2.0 (#256): a misspelled or omitted key currently degrades silently (None/EMPTY_REGEX) with no traceback pointing at the typo. Emits DeprecationWarning naming the miss and the known keys; will raise AttributeError in 2.0. .get() remains available for intentional soft access
  • Deprecate HumanName slice access (name[1:-3]) and item assignment (name['first'] = value) for removal in 2.0 (#258): field access by position has no real use case, and item assignment duplicates plain attribute assignment. Both emit DeprecationWarning; string-key access (name['first']) is unaffected
  • Deprecate SetManager.add_with_encoding() itself for removal in 2.0 (#245), regardless of argument type: use add() instead (decoding bytes first). Previously only the bytes path warned; the str path was silent even though the whole method goes away
  • Deprecate loading a legacy-format Constants pickle (written by nameparser <= 1.2.x, before the 1.3.0 pickle fix) for removal in 2.0 (#279): __setstate__'s migration shim currently skips the stale computed-property key silently. Emits DeprecationWarning once per call telling users to re-pickle; will raise ValueError in 2.0
  • Fix the "Lastname, Firstname" comma format not being recognized when the input uses the Arabic comma ، (U+060C, the standard comma in Arabic/Persian/Urdu text) or the fullwidth CJK comma (U+FF0C) instead of the ASCII comma: both variants now also split the format and no longer leak into the parsed output (closes #265)

Full changelog: https://github.com/derek73/python-nameparser/blob/master/docs/release_log.rst

v1.3.1

Choose a tag to compare

@derek73 derek73 released this 11 Jul 08:55
17d1946

Patch release with two output-corruption bug fixes. No API changes. Full details in the release log.

Bug fixes

  • Invisible Unicode bidirectional control characters are now stripped during preprocessing (#266, thanks @apoorva-01) — LRM/RLM/ALM, the embedding/override marks, and the isolates U+2066–U+2069 previously survived parsing and stuck to first/last/etc., so a copy-pasted right-to-left name silently failed equality and dedup. Disable via CONSTANTS.regexes.bidi = False.
  • str() no longer corrupts name text containing the substring "None" when empty_attribute_default is None (#254) — e.g. "Nonez Smith" rendered as "z Smith". Empty attributes are now substituted as '' before the format string is applied, instead of scrubbing the interpolated "None" from the output afterward. Present since 2016; the default '' configuration was never affected.

v1.3.0

Choose a tag to compare

@derek73 derek73 released this 06 Jul 06:35
b7b728b

This release works through essentially the entire backlog of open issues — nearly every bug and feature request in the tracker, including several dating back to 2014. Alongside the fixes, it adds long-requested functionality: maiden name support, surname-prefix splitting, patronymic name ordering, and a set of new customization hooks on Constants.

The release was developed with Claude Code, and every fix and feature ships with regression tests. The complete list of changes is below.

This release is the bridge release ahead of 2.0: every planned 2.0 removal now has its replacement shipped and emits a DeprecationWarning naming it, so code can migrate while both APIs work. Full details in the release log.

Deprecations (removal in 2.0)

  • == and hash() on HumanName (#223) — the design's three promises (case-insensitive equality, equality with plain strings, hashability) are mutually inconsistent, equality depends on string_format, and maiden is invisible to it. Replacements, new in this release: matches() for semantic comparison (name.matches("Smith, John") and name.matches("John Smith") both match) and comparison_key() for sets, dicts, dedup, and sorting.
  • bytes input (#245) — decode first, e.g. value.decode('utf-8'); the encoding kwarg is deprecated with it.
  • SetManager.__call__ (#243) — iterate the manager or copy with set(manager).
  • SetManager.remove() of a missing member (#243) — will raise KeyError in 2.0 like set.remove; new discard() is the intentional ignore-missing spelling.

Breaking changes

  • HumanName is no longer its own iterator; iter(name) returns a fresh independent iterator (fixes state corruption from break/nested loops/len() mid-loop) (#225)
  • Vestigial unparsable attribute removed (unreachable since 2013; use len(name) == 0); __ne__ removed (derived from __eq__)
  • REGEXES and CAPITALIZATION_EXCEPTIONS are now dicts — iterate with .items() (#227, #233)
  • Internal __process_initial__ renamed _process_initial (dunder names are reserved)

Behavior changes affecting parse output (default-on)

  • Bound Arabic given-name prefixes (abdul, abu, …) join forward into the first name (#150); disable via CONSTANTS.bound_first_names.clear()
  • A leading unknown multi-letter period-abbreviation ("Major.") parses as a title (#109)
  • Parsing no longer mutates the shared CONSTANTS it reads — parse results no longer depend on what was parsed earlier in the process, and parsing is thread-safe against config writes

New

  • maiden field with maiden_delimiters routing (#22); given_names (#157); last_base/last_prefixes for surname particles (#130, #132)
  • patronymic_name_order for Russian and Turkic formal-order names (#85, #185); middle_name_as_last (#133); non_first_name_prefixes (#121); expanded international titles and prefixes (#18, #101, #187)
  • initials_separator (#171), suffix_delimiter (#156), nickname_delimiters (#110, #112), suffix_acronyms_ambiguous (#111)

Hardening & fixes

  • Config boundaries now fail loud instead of silently corrupting: bare strings no longer shred into characters (#238), assignment paths validate (#239, #241), TupleManager rejects malformed input (#242), membership checks normalize like every other operation (#244), Constants subclasses are respected (#226)
  • Customized Constants survive pickle/deepcopy (#167, #168, #169); many parsing fixes — suffix boundaries with prefixed last names (#100), repeated prefix chains (#208), degenerate comma input, roman-numeral and suffix recognition in comma formats (#136, #144), and more

v1.2.1

Choose a tag to compare

@derek73 derek73 released this 19 Jun 23:04

What's Changed

  • Fix initials() interpolating the literal None for empty name parts when empty_attribute_default = None (e.g. "J. None D."); empty parts now render as an empty string and a fully-empty result returns empty_attribute_default
  • Add python -m nameparser "Name String" command-line helper that prints a parsed name
  • Reorganize the test suite from a single tests.py into a tests/ pytest package

Full Changelog: v1.2.0...v1.2.1

v1.2.0

Choose a tag to compare

@derek73 derek73 released this 11 Jun 08:43

What's changed

  • Drop Python 2 and Python < 3.10 support; Python 3.10–3.14 now required
  • Add type hints and type declarations (PEP 561 py.typed marker)
  • Migrate build tooling to pyproject.toml, drop setup.py
  • Remove dead Python 2 compatibility shims (ENCODING constant, next() aliases)
  • Modernize CI: uv-based workflow, trusted publishing to PyPI, Dependabot

v1.1.3

Choose a tag to compare

@derek73 derek73 released this 21 Sep 00:11
  • Fix case when we have two same prefixes in the name (#147)

v1.1.2

Choose a tag to compare

@derek73 derek73 released this 14 Nov 03:04
  • Add support for attributes in constructor (#140)
  • Make HumanName instances hashable (#138)
  • Update repr for names with single quotes (#137)

v1.1.1

Choose a tag to compare

@derek73 derek73 released this 29 Jan 02:28
  • Fix bug in is_suffix() handling of lists (#129)

v1.1.0

Choose a tag to compare

@derek73 derek73 released this 04 Jan 04:30

v1.0.6

Choose a tag to compare

@derek73 derek73 released this 08 Feb 21:44
  • Fix Python 3.8 syntax error warning (#104)