Hand-curated dataset of English names and nicknames.
Project description
Nicknames
A hand-curated CSV file (names.csv) containing English given names (first names) and their associated nicknames. There are Python and SQL bindings provided for convenience.
This currently contains roughly 1100 canonical names.
Any help from people to clean or add to it is greatly appreciated.
We store the names in semantic triplets of (name1, relationship, name2), for example
("alexander", "has_nickname", "alex") or ("alexander", "is_translation_of:en-sp", "alejandro").
As of July 2025, we only store the has_nickname relationship, but if you
want to add more relationships, please open a pull request (or file an issue first
if it is a lot of work to confirm that you are heading in the right direction).
This lookup file was initially created by mining this genealogy page from the Center for African American Research, Inc. Because the lookup originates from a dataset used for genealogy purposes there are old names that aren't commonly used these days, but there are recent ones as well. Examples are "gregory", "greg", or "geoffrey", "geoff". There was also a significant effort to make it machine readable, i.e. separate it with commas, remove human conventions like "rickie(y)" would need to be made into two different names "rickie", and "ricky". Due to the source of the original data, the dataset is heavily biased towards traditionally African American names. Names from other groups may or may not be present.
This project was created by Old Dominion University - Web Science and Digital Libraries Research Group. More information about the creation of this lookup can be found on this blog post about the creation of this library
SQL API
See the sql/ directory.
Python API
The Python parser is available on PyPI from
pip install nicknames
and then you can do:
from nicknames import NickNamer
nn = NickNamer()
# Get the nicknames for a given name as a set of strings
nicks = nn.nicknames_of("Alexander")
assert isinstance(nicks, set)
assert "al" in nicks
assert "alex" in nicks
# Note that the relationship isn't symmetric: al is a nickname for alexander,
# but alexander is not a nickname for al.
assert "alexander" not in nn.nicknames_of("al")
# Capitalization is ignored and leading and trailing whitespace is ignored
assert nn.nicknames_of("alexander") == nn.nicknames_of(" ALEXANDER ")
# Queries that aren't found return an empty set
assert nn.nicknames_of("not a name") == set()
# The other useful thing is to go the other way, nickname to canonical:
# It acts very similarly to nicknames_of.
can = nn.canonicals_of("al")
assert isinstance(can, set)
assert "alexander" in can
assert "alex" in can
assert "al" not in nn.canonicals_of("alexander")
# You can combine these to see if two names are interchangeable:
union = nn.nicknames_of("al") | nn.canonicals_of("al")
are_interchangeable = "alexander" in union
For more advanced usage, such as loading your own data, read the source code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nicknames-1.0.0.tar.gz.
File metadata
- Download URL: nicknames-1.0.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28a53d1f12c356a004deee0beec00ade131aa9c563b4fd9b9a4a3d7e3a21a837
|
|
| MD5 |
f15c9e02974d57d287c230897b09aa47
|
|
| BLAKE2b-256 |
1ad2c46700f88ec4e359cafc8a341ec2fa7338f5c867ebd6e214960ac68d7da2
|
Provenance
The following attestation bundles were made for nicknames-1.0.0.tar.gz:
Publisher:
release.yml on carltonnorthern/nicknames
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nicknames-1.0.0.tar.gz -
Subject digest:
28a53d1f12c356a004deee0beec00ade131aa9c563b4fd9b9a4a3d7e3a21a837 - Sigstore transparency entry: 273856294
- Sigstore integration time:
-
Permalink:
carltonnorthern/nicknames@9cc7712d97d8b0fbc2e087cd4983a9cf6ccc0515 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/carltonnorthern
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9cc7712d97d8b0fbc2e087cd4983a9cf6ccc0515 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file nicknames-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nicknames-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b7a10e7f0c49c93b6bde4c78dd0c6d7d609d79c019c9bfa961c290183d4fe68
|
|
| MD5 |
0dc5af816be1bd7d608fec54879ea5cc
|
|
| BLAKE2b-256 |
454aa3a70bf61ff8985e6114a54648385ce710e41e260c60bbd2121848c1fb00
|
Provenance
The following attestation bundles were made for nicknames-1.0.0-py3-none-any.whl:
Publisher:
release.yml on carltonnorthern/nicknames
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nicknames-1.0.0-py3-none-any.whl -
Subject digest:
4b7a10e7f0c49c93b6bde4c78dd0c6d7d609d79c019c9bfa961c290183d4fe68 - Sigstore transparency entry: 273856303
- Sigstore integration time:
-
Permalink:
carltonnorthern/nicknames@9cc7712d97d8b0fbc2e087cd4983a9cf6ccc0515 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/carltonnorthern
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9cc7712d97d8b0fbc2e087cd4983a9cf6ccc0515 -
Trigger Event:
workflow_dispatch
-
Statement type: