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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.064s · 20.9MB
glibcpy 3.10–3.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}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'randomname'
The `randomname` package has not been installed in your Python environment.
fixpip 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.
fixfrom 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`.
fiximport 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.
fixrandomname.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.