Nicknames

1.0.1 · active · verified Thu Apr 16

The 'nicknames' library provides a hand-curated dataset of English given names and their associated nicknames or diminutive names. It offers a Python API to query these relationships. The current version is 1.0.1, released on March 5, 2026, and follows a release cadence tied to data updates and feature enhancements. It is actively maintained by the Old Dominion University - Web Science and Digital Libraries Research Group. [4, 5]

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to instantiate the `NickNamer` class to find nicknames for a given name and canonical names for a given nickname. It also shows how to combine these methods to check for interchangeability and how to access the raw `name_triplets` data directly. [4]

from nicknames import NickNamer, name_triplets

# Initialize the NickNamer class
nn = NickNamer()

# Get nicknames for a given name
nicks_for_alexander = nn.nicknames_of("Alexander")
print(f"Nicknames for Alexander: {nicks_for_alexander}")
# Expected: {'al', 'alex'}

# Get canonical names for a given nickname
canonicals_for_al = nn.canonicals_of("al")
print(f"Canonical names for al: {canonicals_for_al}")
# Expected: {'alexander', 'alex'}

# Check if two names are interchangeable (via nicknames or canonical forms)
alexander_is_al_interchangeable = "alexander" in (nn.nicknames_of("al") | nn.canonicals_of("al"))
print(f"Is Alexander interchangeable with al? {alexander_is_al_interchangeable}")

# Access the raw data triplets
first_three_triplets = name_triplets()[:3]
print(f"First three raw name triplets: {first_three_triplets}")

view raw JSON →