Skip to main content

russian-names

Library for generation of russian names. Cyrillic and latin alphabet. Useful for test, mocks etc.

Installation

Install with pip:

$ pip install russian-names

Usage

Import package:

>>> from russian_names import RussianNames

Basic example

Print random name:

>>> RussianNames().get_person()

Владислав Николаевич Ильин

Batch

Create batch of persons. Set size in count option.

>>> rn = RussianNames(count=5, patronymic=False, name_reduction=True)
>>> batch = rn.get_batch()
>>> print(batch)

('Л. Ходилова', 'А. Креткова', 'Р. Тишанов', 'И. Закудряев', 'В. Демчин')

Generator

Use russian names as generator

>>> rn = RussianNames(count=7, patronymic=False, transliterate=True)
>>> for person in rn:
        print(person)

    Valeriy Forunin
    Pavel Senakosov
    Violetta Scherbovskaya
    Natalya Furshtatova
    Violetta Chuhontseva
    Polina Aksentsova
    Galina Botova

Options

List of options:

option

description

type

default

name

bool

True

name_reduction

Anna -> A.

bool

False

name_max_len

int

10

patronymic

bool

True

patronymic_reduction

Fedorovich -> F.

bool

False

patronymic_max_len

int

10

surname

bool

True

surname_reduction

Ivanov -> I.

bool

False

surname_max_len

int

10

count

int

10

gender

float

0.5

transliterate

cyrillic to latin

bool

False

output_type

output data format

‘str’ or ‘list’ or ‘tuple’ or ‘dict’

‘str’

seed

random seed

int

None

rare

use non popular names

bool

False

uppercase

set uppercase to all names

bool

False

Examples of options

For credit cards:

>>> RussianNames(count=3, patronymic=False, transliterate=True, uppercase=True).get_batch()
    ('SEMEN SISYKIN', 'LYBOV POLEZAEVA', 'MIHAIL KAMAGOROV')

For polls:

>>> RussianNames(count=3, surname_reduction=True).get_batch()
    ('Анатолий Юрьевич Ш.', 'Софья Ивановна Т.', 'Валерия Валерьевна Н.')

Only women:

>>> RussianNames(count=3, gender=0.0).get_batch()
    ('Кристина Петровна Тоншина', 'Клавдия Эдуардовна Караулова', 'Лариса Викторовна Короткина')

List of dicts:

>>> RussianNames(count=3, output_type='dict').get_batch()
    (
        {'name': 'Кирилл', 'patronymic': 'Денисович', 'surname': 'Дрожжов'},
        {'name': 'Андрей', 'patronymic': 'Кириллович', 'surname': 'Шувиков'},
        {'name': 'Роман', 'patronymic': 'Евгеньевич', 'surname': 'Малеванкин'}
    )

Get current option

Print options

>>> rn = RussianNames(count=10, gender=0.5, surname_max_len=15,
                      transliterate=True, uppercase=True)
>>> print(rn)

    RussianNames settings:
         name: True
         name_reduction: False
         name_max_len: 10
         patronymic: True
         patronymic_reduction: False
         patronymic_max_len: 10
         surname: True
         surname_reduction: False
         surname_max_len: 15
         count: 10
         gender: 0.5
         transliterate: True
         output_type: str
         seed: None
         rare: False
         uppercase: True

Tests

$ pytest -v tests/*

License

This project is licensed under the MIT License - see the LICENSE.txt file for details

Metadata

Release files for russian-names 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for russian-names 0.1.2
File Interpreter ABI Platform Actions
russian_names-0.1.2-py3-none-any.whl Python 3 none any Details for russian_names-0.1.2-py3-none-any.whl

Release files / russian_names-0.1.2-py3-none-any.whl

Download URL russian_names-0.1.2-py3-none-any.whl
Size 652.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
284fbe55f0901531e8771a8b9c0adcd463d2f66c2f7a296b28c406808a9fa15a
BLAKE2b-256 checksum
How to use checksums
c1f7aed1f274b294728eaa67d941db817a21b660f7a6852cabc0c05513466ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Security for russian-names 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page