Registry / data / randomname

randomname

JSON →
library0.2.1pypypi✓ verified 23d ago

randomname is a Python library that generates random adjective-noun style names, similar to those used by Docker containers or GitHub repositories, to create memorable and easy-to-type unique identifiers. It is currently at version 0.2.1 and has an infrequent release cadence, with the last update in January 2023.

pip install randomname
INSTALL
IMPORT
SIG · RANDOMNAME
R
randomname
datapythonv0.2.1
Install
2.8s avg
Import
59ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.064s · 20.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.8s · import 0.054s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_name
import randomname name = randomname.get_name()
The primary function `get_name()` is directly accessible after importing the `randomname` package.

This quickstart demonstrates how to generate random names using `randomname.get_name()`. It shows basic usage, how to specify word categories (adjectives, nouns, verbs, ipsum, names), and how to define a custom format for the generated names.

import randomname # Generate a simple adjective-noun name name1 = randomname.get_name() print(f"Generated name 1: {name1}") # Generate a name with specific categories (e.g., from 'weather' adjectives and 'cats' nouns) name2 = randomname.get_name(adj='weather', noun='cats') print(f"Generated name 2 (weather-cats): {name2}") # Generate a name with multiple adjective categories name3 = randomname.get_name(adj=['colors', 'sound'], noun='ghosts') print(f"Generated name 3 (colors-sound-ghosts): {name3}") # Generate a name with a custom format (e.g., verb-adjective-noun) name4 = randomname.get_name(fmt='v/art a/music_theory n/apex_predators') print(f"Generated name 4 (custom format): {name4}")
Debug
Known issues
gotchaRepeated calls to `randomname.get_name()` may yield duplicate names, as the library does not inherently guarantee uniqueness across calls. If unique names are required, callers must implement their own tracking and retry logic.
fix
Maintain a set of generated names and regenerate if a duplicate is produced, or use a different generator like 'UniqueRandomNameGenerator' if available in a similar library (e.g., 'funkybob').
affects: All versions
gotchaThe wordlists used by `randomname` are sourced externally and, while intended for general use, may contain words that some users find offensive or inappropriate. The library's README acknowledges this and requests users to report such instances.
fix
Review generated names in sensitive contexts. Consider customizing wordlists by supplying specific categories or custom words to `get_name()` if stricter control over vocabulary is needed.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'randomname'
The `randomname` package has not been installed in your Python environment.
fix
pip install randomname
ImportError: cannot import name 'randomname' from 'randomname'
The primary function to generate names is `generate_name`, not `randomname` itself as a function or object.
fix
from randomname import generate_name
AttributeError: module 'randomname' has no attribute 'generate_random_name'
The correct function name to generate a name is `generate_name`, not a variation like `generate_random_name`.
fix
import randomname
name = randomname.generate_name()
AttributeError: 'int' object has no attribute 'join'
The `sep` (separator) argument in `generate_name` must be a string, but a non-string type (like an integer) was provided.
fix
randomname.generate_name(sep='_') # Ensure sep is a string
Upgrade
Version history
0.2.1latest on PyPI · released Jan 29, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Resources
randomname — pip install randomname · libregistry