Генерация случайных имен python

names 0.3.0

The script is available on PyPI. To install with pip:

Usage

Names can be used as a command line utility or imported as a Python package.

Command Line Usage

To use the script from the command line:

Python Package Usage

Here are examples of all current features:

License

This project is released under an MIT License.

Data in the following files are public domain (derived from 1990 Census data):

Changes

0.3.0 (2013-05-14)

0.2 (2013-02-17)

Contributing

Please file bugs to the Github issue tracker. Pull requests are welcome.

Hacking and Pull Requests

Please try to conform to PEP8 for code contributions and ensure that the tests continue to function.

Please include new tests with your pull requests when appropriate.

Running the tests

You will need tox and coverage installed to run the tests on your code:

To run the tests and generate a coverage report:

The coverage output should look similar to this:

_____________________ summary _____________________ py27: commands succeeded py32: commands succeeded py33: commands succeeded pypy: commands succeeded flake8: commands succeeded congratulations :) Name Stmts Miss Branch BrMiss Cover -------------------------------------------------- names/__init__ 25 0 8 0 100% names/main 4 0 0 0 100% -------------------------------------------------- TOTAL 29 0 8 0 100%

Источник

russian-names 0.1.2

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

Installation

Usage

>>> from russian_names import RussianNames

Basic example

>>> 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

Examples of options

>>> RussianNames(count=3, patronymic=False, transliterate=True, uppercase=True).get_batch() ('SEMEN SISYKIN', 'LYBOV POLEZAEVA', 'MIHAIL KAMAGOROV')
>>> RussianNames(count=3, surname_reduction=True).get_batch() ('Анатолий Юрьевич Ш.', 'Софья Ивановна Т.', 'Валерия Валерьевна Н.')
>>> RussianNames(count=3, gender=0.0).get_batch() ('Кристина Петровна Тоншина', 'Клавдия Эдуардовна Караулова', 'Лариса Викторовна Короткина')
>>> RussianNames(count=3, output_type='dict').get_batch() ( , , )

Get current option

>>> 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

License

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

Источник

How to generate random names (first and last names) with python ?

In python, I used to enter random names manually (like John Doe Or Jana Doe) to create for example fake database and for testing. However to generate random names a better solution is to use for example the module «names» created by Trey Hunner:

Install the module names

To install names with pip

Install the module names with anaconda

If you work with anaconda just do:

conda create -n my_env source activate my_env conda install pip pip install names 

Create random names with python

Then to create random names just do:

import names for i in range(10): print(names.get_full_name()) 
April Reiter Emory Miller David Ballin Alice Trotter Virginia Rios Thomas Wheeler James Harrell Nicolas White Mary Flanagan Velda Grubb 

Create random male names

for i in range(10): rand_name = names.get_full_name(gender='male') print(rand_name) 
Arthur Manning Victor Ishee Roland Chambless Fred Shawler Nicholas North James Michaud Mitchell Dorsey Willie Porras Antonio Green Joe Sherman 

Create random female names

for i in range(10): rand_name = names.get_full_name(gender='female') print(rand_name) 
Lorri Boles Carin Hodge Judith Mcdaniel Elaine Jones Terri Tanguay Caroline Crowley Edith Jones Katlyn Bellamy Jeannie Mayberry Marge Swaim 

Create random male first names

for i in range(10): rand_name = names.get_first_name(gender='male') print(rand_name) 
George Shawn Robert Steven William James Christopher James Michael Donovan 

Create random female first names

for i in range(10): rand_name = names.get_first_name(gender='female') print(rand_name) 
Jessica Stephanie Ann Emma Heather Anna Kelli Pauline Tanya Kathy 

Create random last names

for i in range(10): rand_name = names.get_last_name() print(rand_name) 
Sanders Meyer Ingram Straight Caldwell Cox Hudson Basso Millhouse Rivett 

References

Benjamin

Greetings, I am Ben! I completed my PhD in Atmospheric Science from the University of Lille, France. Subsequently, for 12 years I was employed at NASA as a Research Scientist focusing on Earth remote sensing. Presently, I work with NOAA concentrating on satellite-based Active Fire detection. Python, Machine Learning and Open Science are special areas of interest to me.

Skills

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Python data provider module that returns random people names, addresses, state names, country names as output. Useful for unit testing and automation.

License

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

  • Outputs RANDOM People names, US state, counties and addresses, Countries and Company names.
  • Useful for testing Name/Address fields with random data.
  • No dependencies required. Just pure Python v3+
  • Simply download the repo to your project folder or
git clone https://github.com/navchandar/Python-Random-Name-Generator.git
  • And start using for your development/testing purposes.
  • Please add your ideas/suggestions or more test data here.
import random_names random_names.First() # outputs random first name random_names.Middle() # outputs random middle name random_names.Last() # outputs random last name random_names.Full() # outputs random first and last name random_names.Company() # outputs random company name random_names.Address() # outputs random Address random_names.StateCode() # outputs random US State Code random_names.States() # outputs random US State name random_names.Country() # outputs random Country name random_names.Places() # outputs random Place name

About

Python data provider module that returns random people names, addresses, state names, country names as output. Useful for unit testing and automation.

Источник

Читайте также:  Html site templates web
Оцените статью