Skip to main content

Build Status PyPI PyPI version Documentation License Downloads Codecov

nameparser parses human names into seven fields — title, given, middle, family, suffix, nickname, maiden. Results are immutable, configuration is composable, and locale packs are opt-in.

📣 nameparser 2.0 is out. Existing HumanName code keeps working through 2.x, and most 1.x code needs no changes. The migration guide has the field-by-field map. Please open an issue for anything that parses wrong.

2.1 adds East Asian name support. 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. See East Asian names.

Installation

pip install nameparser

Requires Python 3.11+.

Quick Start Example

>>> from nameparser import parse
>>> name = parse("Dr. Juan Q. Xavier de la Vega III (Doc Vega)")
>>> name
<ParsedName: [
    title: 'Dr.'
    given: 'Juan'
    middle: 'Q. Xavier'
    family: 'de la Vega'
    suffix: 'III'
    nickname: 'Doc Vega'
]>
>>> name.family_base, name.family_particles
('Vega', 'de la')
>>> name.given_names, name.surnames
('Juan Q. Xavier', 'Q. Xavier de la Vega')
>>> name.render("{family}, {given}")
'de la Vega, Juan'

>>> parse("김민준").family                     # Korean: unspaced, split on the census list
'김'
>>> parse("高橋 みなみ").family                 # Japanese: kanji with kana, family first
'高橋'
>>> parse("김민준씨").suffix                   # an honorific written against the name
'씨'
>>> parse("г-н Иван Петров").title             # Cyrillic title
'г-н'
>>> parse("محمد بن سلمان").family              # Arabic: بن chains onto the family name
'بن سلمان'

>>> from nameparser import locales, parser_for
>>> chinese = parser_for(locales.ZH)           # Han text does not say which language
>>> chinese.parse("毛泽东").family              # so splitting it is opt-in
'毛'
>>> russian = parser_for(locales.RU)
>>> russian.parse("Сидоров Иван Петрович").family
'Сидоров'
>>> locales.available()
('ja', 'ru', 'tr_az', 'zh')

Learn more

  • Using the parser — the full tour: input shapes, aggregates, rendering, comparison, ambiguities, tokens

  • Customizing the parser — vocabulary, behavior, and presentation

  • Locale packs — opt-in bundles for East Slavic patronymics, Turkic markers, and more

  • There’s also a CLI: python -m nameparser --json "Doe, John"

Coming from 1.x

HumanName and CONSTANTS keep working in 2.0 — same imports, same attributes, same mutation API. What 2.0 removes is the batch of deprecations 1.3 and 1.4 announced, so if your test suite runs clean on 1.4 under python -W error::DeprecationWarning, you are nearly done. Two things that check will not catch: four removals 1.4 never warned about (three raise on contact, the fourth only warns), and one that changes results silently — name == "John Smith" is now False. Migrating from HumanName covers both, and translates a v1 customization into the new API whenever that’s convenient for you.

See the release log for the full list of changes in the 2.0 series.

License

LGPL licensed. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nameparser-2.2.0.tar.gz (582.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nameparser-2.2.0-py3-none-any.whl (231.5 kB view details)

Uploaded Python 3

File details

Details for the file nameparser-2.2.0.tar.gz.

File metadata

  • Download URL: nameparser-2.2.0.tar.gz
  • Upload date:
  • Size: 582.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nameparser-2.2.0.tar.gz
Algorithm Hash digest
SHA256 1320c738862fc170b5a14fa996ff103277e5f87a14da1d42ddc254d70fbb6491
MD5 76d1b0732b708b125f953c3af6a5420d
BLAKE2b-256 c89ec4cdb711b9de40e8391d56ca29db712c2d1b25650a3183587fe74bcbbf37

See more details on using hashes here.

Provenance

The following attestation bundles were made for nameparser-2.2.0.tar.gz:

Publisher: python-publish.yml on derek73/python-nameparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nameparser-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: nameparser-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 231.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nameparser-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 047405a277099d47b100126363d5031914056256e0034ff5da350aa6db6f835e
MD5 5e503f4bc49a5ac857a647028dc81bdb
BLAKE2b-256 604e826a0890abd22338c5e2e2102059efebec6212749b170e242e5bb9646086

See more details on using hashes here.

Provenance

The following attestation bundles were made for nameparser-2.2.0-py3-none-any.whl:

Publisher: python-publish.yml on derek73/python-nameparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 files

2.1.0

2 files

2.0.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.16

2 files

0.3.15

2 files

0.3.14

2 files

0.3.13

2 files

0.3.12

2 files

0.3.11

1 file

0.3.10

1 file

0.3.9

1 file

0.3.8

1 file

0.3.7

1 file

0.3.6

1 file

0.3.5

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.10

1 file

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.0

1 file

0.1.4

1 file

0.1.3

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page