Python Human Name Parser¶
Version 3.2.0
nameparser parses human names into seven fields — title, given,
middle, family, suffix, nickname, maiden. Results are immutable,
configuration is composable (Lexicon for
vocabulary, Policy for behavior), and locale
packs are opt-in. Requires Python 3.11+.
>>> from nameparser import parse
>>> name = parse("Dr. Juan Q. Xavier de la Vega III")
>>> name.given, name.family
('Juan', 'de la Vega')
>>> name.render("{family}, {given}")
'de la Vega, Juan'
New here? Getting started takes you through the three steps most people need:
Parse one name into its fields, as above.
Have a list of names from one source? Settings for a list of names reads how it is written (its order, patronymics, and family names written as letters, in capitals or as two) and returns a parser configured for it.
Joining records from several sources? Matching names across sources groups the names and compares them field by field.
Coming from 1.x, or from 2.x code using HumanName? Migrating to 3.0.
Start here
Reading names
Lists of names
- Settings for a list of names
- How many names to give it
- Reading the result
- Names that disagree with the list
- When the list decides a setting
- What a name votes on
- Lists with patronymics
- Lists that end names in letters
- Lists that write the family name in capitals
- Lists that give two family names
- Choosing a language pack
- Keeping the settings you applied
- Where it stops
- Matching names across sources
Configuring
- Customizing the parser
- Behavior: Policy
- Setting a field
- The fields
- Family-first name order
- Declaring the order settles where a surname ends
- Names written as one word
- Names with two family names
- Names with a compound given name
- Names ending in initials that are the family name
- Family names written in capitals
- Nicknames, maiden names, and brackets
- Suffixes not separated by commas
- A single letter after a comma
- Credentials the vocabulary doesn’t list
- Keeping emoji and control characters
- Locale packs
- Notes by language
Background and reference
Indices and tables¶
GitHub Project: https://github.com/derek73/python-nameparser