Dependency-free Korean name generator library and CLI extracted from Onnuri seed tooling
Project description
korname-generator
Dependency-free Korean name generator library and CLI.
It generates Korean names with both romanized and Hangul forms, supports seeded
repeatable output, allows male/female/gender-neutral name pools, and can be
customized with a config.yaml file.
Requirements
- Python 3.10+
- No runtime dependencies
Installation
From PyPI
python -m pip install korname-generator
The PyPI distribution is korname-generator; the installed console command is
korean-name-generator.
From this repository, editable development install
Use this when you are working on the package locally:
git clone <repo-url>
cd korean-name-generator
python -m venv .venv
. .venv/bin/activate
python -m pip install -e .
From this repository, normal local install
Use this when you just want the CLI and importable package from the local checkout:
cd korean-name-generator
python -m pip install .
Build and install a wheel
python -m pip wheel . --no-deps -w dist
python -m pip install dist/korname_generator-0.1.0-py3-none-any.whl
After installation, the console command is available as:
korean-name-generator --help
You can also run it without installing by setting PYTHONPATH from the repo
root:
PYTHONPATH=src python -m korean_name_generator --help
CLI examples
Generate five names:
korean-name-generator --count 5
Generate deterministic output with a seed:
korean-name-generator --count 5 --seed 7
Select a given-name pool:
korean-name-generator --count 3 --gender male
korean-name-generator --count 3 --gender female
korean-name-generator --count 3 --gender neutral
Use Korean-order display in plain output:
korean-name-generator --count 3 --order korean
Emit JSON:
korean-name-generator --count 2 --seed 1 --format json
Example JSON shape:
[
{
"family_name_en": "Lim",
"family_name_ko": "임",
"given_name_en": "Seseo",
"given_name_ko": "세서",
"gender": "female",
"romanized": "Seseo Lim",
"hangul": "임세서"
}
]
Emit CSV:
korean-name-generator --count 10 --format csv > names.csv
Use an explicit config file:
korean-name-generator --count 3 --gender neutral --config ./config.yaml
Python API examples
Generate one name:
from korean_name_generator import generate_name
name = generate_name(gender="female", random_seed=7)
print(name.romanized) # Western order, e.g. "Seseo Lim"
print(name.hangul) # Korean order, e.g. "임세서"
Generate many names:
from korean_name_generator import generate_names
names = generate_names(10, gender="male", random_seed=42)
for name in names:
print(name.display())
Reuse a generator so the random state advances between calls:
from korean_name_generator import KoreanNameGenerator
generator = KoreanNameGenerator(random_seed=7)
print(generator.generate(gender="neutral"))
print(generator.generate(gender="neutral"))
Load a custom config:
from korean_name_generator import KoreanNameGenerator
generator = KoreanNameGenerator.from_config("config.yaml", random_seed=7)
name = generator.generate(gender="female")
print(name.as_dict())
Configuration
The packaged defaults live in src/korean_name_generator/config.yaml.
Runtime config resolution is:
- explicit
--config/config_path $KOREAN_NAME_GENERATOR_CONFIG- local
./config.yaml - packaged defaults
Config files use this shape:
name_pools:
family_names:
- { en: Kim, ko: 김 }
first_syllables:
- { en: Ji, ko: 지 }
male_second_syllables:
- { en: Ho, ko: 호 }
female_second_syllables:
- { en: Na, ko: 나 }
gender_neutral_second_syllables:
- { en: Sol, ko: 솔 }
The parser is intentionally small and dependency-free. It supports the package's
YAML shape shown above and JSON-compatible YAML. Each pool must be non-empty and
each entry must include non-empty en and ko values.
The generator filters out repeated given-name syllables such as 지지. If a
custom second-syllable pool cannot provide a non-repeating option for the chosen
first syllable, generation raises ValueError.
Output fields
KoreanName.as_dict() and structured CLI output include:
| Field | Meaning |
|---|---|
family_name_en |
Romanized family name |
family_name_ko |
Hangul family name |
given_name_en |
Romanized two-syllable given name |
given_name_ko |
Hangul two-syllable given name |
gender |
Selected pool: female, male, or neutral |
romanized |
Western-order display name |
hangul |
Korean-order Hangul display name |
Development and verification
PYTHONPATH=src python -m unittest discover -s tests
python -m compileall -q src tests
PYTHONPATH=src python -m korean_name_generator --count 2 --seed 1 --format json
python -m pip wheel . --no-deps -w dist
Or use the Makefile shortcuts:
make lint
make test
make check
Release automation
Merges to main or dev run the GitHub Actions workflow in
.github/workflows/release.yml. The workflow first runs make check (Ruff
linting, Ruff format checks, Ty type checking, and pytest). If semantic-release
creates a release, the publish job builds the source distribution and wheel with
uv build, then publishes the korname-generator distribution to PyPI.
Publishing uses PyPI Trusted Publishing, so no long-lived PyPI API token is required. The PyPI project trusted publisher is configured with:
- owner:
sagebynature - repository:
korean-name-generator - workflow:
release.yml - environment:
pypi
Semantic-release owns [project].version in pyproject.toml; use Conventional
Commits on main for stable releases and on dev for rc prereleases.
Project details
Release history Release notifications | RSS feed
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 korname_generator-1.0.0.tar.gz.
File metadata
- Download URL: korname_generator-1.0.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba4cdec72ad55d4e501205dd1aa506407c7507d347595d8f7d9457f7d5f594c
|
|
| MD5 |
3daa9efea4bf13233447684d5efde8b4
|
|
| BLAKE2b-256 |
8635b308ed6488e921bfe7097977ca73fb6a4b70fea375fa886da577bccf865f
|
Provenance
The following attestation bundles were made for korname_generator-1.0.0.tar.gz:
Publisher:
release.yml on sagebynature/korean-name-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
korname_generator-1.0.0.tar.gz -
Subject digest:
aba4cdec72ad55d4e501205dd1aa506407c7507d347595d8f7d9457f7d5f594c - Sigstore transparency entry: 1394970442
- Sigstore integration time:
-
Permalink:
sagebynature/korean-name-generator@f0ee824a69aa3d84fe3666612b1167f159da6576 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sagebynature
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f0ee824a69aa3d84fe3666612b1167f159da6576 -
Trigger Event:
push
-
Statement type:
File details
Details for the file korname_generator-1.0.0-py3-none-any.whl.
File metadata
- Download URL: korname_generator-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
216dc6a6bb19365ac00c523750e5a5f8b64fc112e40a780084bd627cf3e84625
|
|
| MD5 |
a95f5e83e45849d94da246bcfe598792
|
|
| BLAKE2b-256 |
0df38c8f5a80c9856330b057a67d9f6632f0bd482551c22df10b577ca6f9ab71
|
Provenance
The following attestation bundles were made for korname_generator-1.0.0-py3-none-any.whl:
Publisher:
release.yml on sagebynature/korean-name-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
korname_generator-1.0.0-py3-none-any.whl -
Subject digest:
216dc6a6bb19365ac00c523750e5a5f8b64fc112e40a780084bd627cf3e84625 - Sigstore transparency entry: 1394970450
- Sigstore integration time:
-
Permalink:
sagebynature/korean-name-generator@f0ee824a69aa3d84fe3666612b1167f159da6576 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sagebynature
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f0ee824a69aa3d84fe3666612b1167f159da6576 -
Trigger Event:
push
-
Statement type: