Skip to main content

A simple Python module for parsing human names into their individual components.

Project description

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 — most 1.x code needs no changes. The migration guide has the field-by-field map, and anything the migration missed can be reported on the discussion issue.

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")
>>> name.given, name.family
('Juan', 'de la Vega')
>>> name.render("{family}, {given}")
'de la Vega, Juan'

Those seven fields are title, given, middle, family, suffix, nickname, and maiden — plus aggregate views like given_names, surnames, family_base, and family_particles for combining or splitting them further.

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.

Project 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.0.0.tar.gz (241.7 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.0.0-py3-none-any.whl (118.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nameparser-2.0.0.tar.gz
Algorithm Hash digest
SHA256 641350d40ab31ec1ce8ab4d701757e7e1b1a35eb6fcf3f34d5e8c6d9a787d2a9
MD5 afb6894f3be33c991eb356c4d0b5c4f4
BLAKE2b-256 e7194fb95a259bce8a9b32c5e4111d3ee4a4a46caad486e156a7716b656cb862

See more details on using hashes here.

Provenance

The following attestation bundles were made for nameparser-2.0.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.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for nameparser-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c8a9e8c82662d9795bdb85fdb32b8ceb480aa58a4bee36e0d52c8d1322e3b73
MD5 9d159b345bf68c9ba07603f31f443436
BLAKE2b-256 ed6ddc038ddc4f58ee9a3eae86446ef48461fec0b116fe067389a97c65f2dcee

See more details on using hashes here.

Provenance

The following attestation bundles were made for nameparser-2.0.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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page