randino for Python
📘 randino.cdget.com
Every option and every example, with Python picked in the sidebar. This README is just the quick start.
randino generates random person names and nicknames in the language you ask for.
- Person names read like names people actually carry — 김민준, Emma Clover, Иванов Иван — and come with their English pronunciation. 9 languages.
- Nicknames are the handles you would pick for a game or a website — 멋진사자, MistyOwl, 고양이꼬리. Built from everyday words across fourteen themes, never from person names.
- Every argument is keyword-only and optional, so
random_name()on its own works. - Pure Python, no dependencies. It imports nothing outside the standard library, and ships a
py.typedmarker so mypy and Pyright read the annotations.
This is the Python half. The npm package and the pub.dev package are the others, and all three generate from the same datasets under the same rules. They version independently, so this package's number and the others' will not always agree.
Install
pip install randino
Requires Python 3.10 or newer. There is nothing else to install.
Person names
from randino import random_name, random_name_details
random_name()
# ['Emma Clover']
random_name(language="ko", count=3)
# ['김태윤', '원동혁', '조진우']
random_name(language="ko", script="roman")
# ['Kim Minjun']
random_name(language="en", gender="female", include_middle_name=True)
# ['Grace Amelia Bennett']
random_name_details(language="ko")[0]
# NameDetail(native='여미주', roman='Yeo Miju', language='ko', gender='female')
| Argument | Type | Default |
|---|---|---|
language |
NameLanguageOption |
"all" |
gender |
NameGenderOption |
"all" |
count |
int |
1 |
style |
int (0 real … 100 invented) |
0 |
min_length / max_length |
int | None |
language |
include_surname |
bool |
True |
include_middle_name |
bool |
False |
script |
NameScript |
"native" |
starts_with |
str |
"" |
unique |
bool |
False |
random_name_details takes the same arguments except script, and returns a NameDetail — native, roman, language and gender — for each name.
Nicknames
from randino import random_nickname, random_nickname_details
random_nickname(language="ko", count=3)
# ['오래된곰', '영원한도마뱀', '귀여운신화다발']
random_nickname(language="en", count=2)
# ['FoggyHillside', 'CraneVoyage']
random_nickname(language="ko", theme="animal", count=2)
# ['깊은연어', '하얀여우갈기']
random_nickname(language="ko", unique_suffix=True, count=2)
# ['달력_U7aNZ', '조용한바구니_RUKAP']
random_nickname(base_word="고양이", count=3)
# ['하얀고양이', '고양이바람', '귀여운고양이뿔']
random_nickname_details(language="ko", unique_suffix=True)[0]
# NicknameDetail(nickname='오래된발견_zVShs', words=('오래된', '발견'), suffix='_zVShs', language='ko', theme='concept')
| Argument | Type | Default |
|---|---|---|
language |
NicknameLanguageOption | None |
None |
theme |
NicknameThemeOption |
"all" |
count |
int |
1 |
style |
int (0 real … 100 invented) |
0 |
min_length / max_length |
int | None |
language |
include_modifier |
bool |
True |
word_separator |
str | None |
language |
base_word |
str |
"" |
unique_suffix |
bool |
False |
unique_suffix_length |
int |
5 |
unique_suffix_separator |
str |
"_" |
unique_suffix_charset |
str |
built-in |
starts_with |
str |
"" |
unique |
bool |
False |
language is the one argument whose default is None rather than "all", and the two are not the same thing: left out, a base_word picks the language it is written in, so "고양이" is never handed an English modifier. Passing "all" mixes every language regardless.
Themes: animal, object, nature, plant, gem, concept, myth, job, music, place, food, sport, vehicle, product.
Helpers and constants
from randino import name_length_range, name_supports_roman, nickname_length_range
name_length_range("ko") # (3, 3)
name_length_range("en", include_middle_name=True) # (12, 24)
name_supports_middle_name("ko") # False
name_supports_roman("en") # False
nickname_length_range("ko") # (1, 12)
NAME_LANGUAGES, NICKNAME_LANGUAGES and NICKNAME_THEMES list what the generators accept; NAME_COUNT_MAX, NAME_LENGTH_MIN / MAX, NICKNAME_COUNT_MAX, NICKNAME_LENGTH_MIN / MAX, NICKNAME_SUFFIX_LENGTH_MAX and NICKNAME_SUFFIX_CHARSET are the bounds every argument is clamped to.
Differences from the npm package
The two generate the same output from the same data, and only the surface is Python's rather than JavaScript's.
| npm | PyPI |
|---|---|
| One options object | Keyword-only arguments |
includeSurname, minLength |
include_surname, min_length |
language: 'ko', language: 'all' |
The same strings, as Literal types |
[number, number] |
tuple[int, int] |
NameDetail / NicknameDetail interfaces |
The same two names, as frozen dataclasses |
detail.words is an array |
detail.words is a tuple |
Development
uv venv && uv pip install -e ".[dev]"
pytest
ruff check . && ruff format --check .
mypy
License
MIT © CDGet
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 randino-1.0.0.tar.gz.
File metadata
- Download URL: randino-1.0.0.tar.gz
- Upload date:
- Size: 76.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
662a68fa8b9a22eb7922f1e4a7f89589dcfaac011d3bbd3c04bcd3c406d210ad
|
|
| MD5 |
0d9b2f7bd15a9555c2622a987159ca8f
|
|
| BLAKE2b-256 |
e3691b65580fa5fb2ca483dd238d33e6633e7d871ad50290dc9678fd3a6dcf59
|
File details
Details for the file randino-1.0.0-py3-none-any.whl.
File metadata
- Download URL: randino-1.0.0-py3-none-any.whl
- Upload date:
- Size: 78.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c276e0689efaee99ecec96cf5be3eabb0ab65ab356263c7099e9e7e09a9de7ca
|
|
| MD5 |
b4f3671558088bf461a94ef082fd3c57
|
|
| BLAKE2b-256 |
e0faee59781b8f77f6124f9391a547b44269a990a1b1655517f6c41817c93266
|