Hand-curated dataset of English names and nicknames.
Project description
Nicknames
A hand-curated CSV file containing English given names (first names) and their associated nicknames.
For more info on the source and format of the data, see https://github.com/carltonnorthern/nicknames. In case that is useful to you, there are also SQL and typescript bindings there.
Python API
The Python package is available on PyPI from
uv add nicknames
and then you can get to the csv data directly:
from nicknames import name_triplets
# name_triplets() returns a list of a NamedTuples:
print(name_triplets()[:3])
# [NameTriplet(name1='aaron', relationship='has_nickname', name2='erin'), NameTriplet(name1='aaron', relationship='has_nickname', name2='ron'), NameTriplet(name1='aaron', relationship='has_nickname', name2='ronnie')]
Or, we have an NickNamer class which provides several convenience methods:
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.1.tar.gz.
File metadata
- Download URL: nicknames-1.0.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b599c1ebf6844c5a65659d46d024c46e9c2cf66b3046e119107e82a14598e6a
|
|
| MD5 |
394f64894445f31bba6279f58a28588d
|
|
| BLAKE2b-256 |
86bab555aee8afcf22fcd463886279d063c48eba71b99a55551cd2a7ca0e3577
|
Provenance
The following attestation bundles were made for nicknames-1.0.1.tar.gz:
Publisher:
release-python.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.1.tar.gz -
Subject digest:
0b599c1ebf6844c5a65659d46d024c46e9c2cf66b3046e119107e82a14598e6a - Sigstore transparency entry: 1047488236
- Sigstore integration time:
-
Permalink:
carltonnorthern/nicknames@6f972fca7182db8c94cb29e0da66d8fcecb00cc1 -
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-python.yml@6f972fca7182db8c94cb29e0da66d8fcecb00cc1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file nicknames-1.0.1-py3-none-any.whl.
File metadata
- Download URL: nicknames-1.0.1-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30608a6a50086bb508e6d5f4fb618ef4f988d5604f73ec1ebcccbc92952f9de9
|
|
| MD5 |
0b237e939530d1c9070f98018ad84511
|
|
| BLAKE2b-256 |
2155f820209a0a0ab535246a901e53fdadb4fcf562b37712d4d7f45c56ae1dab
|
Provenance
The following attestation bundles were made for nicknames-1.0.1-py3-none-any.whl:
Publisher:
release-python.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.1-py3-none-any.whl -
Subject digest:
30608a6a50086bb508e6d5f4fb618ef4f988d5604f73ec1ebcccbc92952f9de9 - Sigstore transparency entry: 1047488247
- Sigstore integration time:
-
Permalink:
carltonnorthern/nicknames@6f972fca7182db8c94cb29e0da66d8fcecb00cc1 -
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-python.yml@6f972fca7182db8c94cb29e0da66d8fcecb00cc1 -
Trigger Event:
workflow_dispatch
-
Statement type: