Skip to main content

Hand-curated dataset of English given names and nicknames

Project description

Nicknames

A hand-curated CSV file containing English given names (first name) and their associated nicknames or diminutive names.

There are Java, Perl, Python, and R parsers provided for convenience.

This is a relatively large list with roughly 1600 names. Any help from people to clean this list up and add to it is greatly appreciated.

This lookup file was initially created by mining this genealogy page. 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".

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

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


Download files

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

Source Distribution

nicknames-0.1.1.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

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

nicknames-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file nicknames-0.1.1.tar.gz.

File metadata

  • Download URL: nicknames-0.1.1.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for nicknames-0.1.1.tar.gz
Algorithm Hash digest
SHA256 edc3717f3e055629b6974d33c4ba514a83074f089d7629a0980661fadb965aed
MD5 5f4a9fb5d0043328fc8dce2ba94f6ef6
BLAKE2b-256 b7e9e6c67a0d4f59421b05f49971bc7e66768a86b35dbefb2e5c95c76f054a9e

See more details on using hashes here.

File details

Details for the file nicknames-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nicknames-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for nicknames-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf11a1a7e5ec6bc051454ee2070e6bae28359f650c4469094662025e0766e62e
MD5 918fca3ed6841e1d4d0e8b77ee224551
BLAKE2b-256 00da13e6655f4ebb24b72bbc4c2547e074c04705986c1710537d738a25e17127

See more details on using hashes here.

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