names-dataset
The python library to handle names
What it is and what it does
names-dataset is a lookup library that maps first and last names to demographic attributes: the countries where they are most common (with probability distributions), gender likelihood, and popularity rank within each country. It wraps a dataset of 730K first names and 983K last names extracted from a public Facebook data leak, covering 105 countries. The library loads this data into memory at startup and provides search, ranking, and autocomplete/fuzzy-match APIs.
You use it to answer questions like "Is Philippe more likely male or female, and from which country?" or to retrieve the top 10 most popular male names in the United States. It supports both exact search and fuzzy matching (to handle misspellings) and real-time autocomplete. The main constraint is its large memory footprint—3.2GB—which means it's best suited for applications where you initialize it once and reuse it, rather than spinning up fresh instances frequently.
Use it for:
- Predict gender and likely country of origin from a person's name in user registration or data-cleaning workflows.
- Populate autocomplete dropdowns in forms that ask for first or last names, with real-time suggestions as the user types.
- Rank names by popularity within a specific country to identify common vs. rare names for analysis or validation.
- Correct misspelled names via fuzzy search, e.g., matching 'Isablel' to 'Isabel' in data import pipelines.
- Generate synthetic or representative name lists for testing, localization, or demographic analysis across multiple countries.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Looks up demographic information about first and last names across 105 countries, including gender likelihood, popularity rank, and fuzzy/autocomplete search.
Yes, if you need name-to-demographics lookup and can accept the 3.2GB memory cost and aging codebase. The package is stable (no known vulnerabilities, permissive license), but expect no active maintenance—use it for read-only demographic queries, not as a foundation for a critical service. Low install friction and reasonable download volume suggest it works in practice for its intended use.
Install
names-dataset on PyPI
pip
pip install names-datasetuv
uv add names-datasetpoetry
poetry add names-datasetInstalling names-dataset
Before you install
Low install friction with just two runtime dependencies (pycountry, numpy). Package is aging—last release was 493 days ago—so expect no active maintenance or bug fixes.
License in practice
MIT license permits commercial and private use with minimal restrictions; the underlying data derives from a public Facebook leak, and names themselves are generally not copyrightable, though legal review is recommended for sensitive use cases.
Quickstart
pip install names-dataset
from names_dataset import NameDataset, NameWrapper
nd = NameDataset()
result = nd.search('Philippe')
print(NameWrapper(result).describe) # Male, France
Requires 3.2GB of RAM to load the full dataset in memory; initialization is slow and should be done once at application startup.
Verify before relying
- Whether the 105 countries claim in the summary matches the 106 countries mentioned in the full dataset section.
- Current state of the GitHub repository (archived status, commit history) since maintenance.repo fields are null.
- Whether Python version support is truly unspecified or if there are undocumented constraints.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pycountry, numpy |
| Maintenance | aging — 493 days since the last release |
| First released | |
| Downloads | 112,862/month — #12,356 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: names_dataset-3.3.1-py3-none-any.whl
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
gender-guesserGuesses the gender of a person from their first…
copyleft · top 5,000 on PyPI
nicknamesProvides a curated dataset of English given…
permissive · top 15,000 on PyPI
GenderizeGenderize is a client library that queries the…
permissive · top 15,000 on PyPI
country_listProvides ISO 3166-1 country codes and names in…
permissive · top 15,000 on PyPI
namesGenerates random human names (first, last, or…
permissive · top 15,000 on PyPI
country-converterConverts and matches country names across…
copyleft · top 5,000 on PyPI
geonamescacheProvides Python dictionaries of geographic data…
permissive · top 5,000 on PyPI
countryinfoCountryinfo provides a Python interface to…
permissive · top 15,000 on PyPI
getnameProvides random name generation for cats, dogs,…
permissive · top 15,000 on PyPI
python-jobspyScrapes job postings from LinkedIn, Indeed,…
unclear · top 15,000 on PyPI