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
pip install names
Install the module names with anaconda
If you work with anaconda just do:
conda create -n my_envsource activate my_envconda install pippip install names
Create random names with python
Then to create random names just do:
import namesfor i in range(10):print(names.get_full_name())
returns for examples:
April ReiterEmory MillerDavid BallinAlice TrotterVirginia RiosThomas WheelerJames HarrellNicolas WhiteMary FlanaganVelda Grubb
Create random male names
for i in range(10):rand_name = names.get_full_name(gender='male')print(rand_name)
returns
Arthur ManningVictor IsheeRoland ChamblessFred ShawlerNicholas NorthJames MichaudMitchell DorseyWillie PorrasAntonio GreenJoe Sherman
Create random female names
for i in range(10):rand_name = names.get_full_name(gender='female')print(rand_name)
returns
Lorri BolesCarin HodgeJudith McdanielElaine JonesTerri TanguayCaroline CrowleyEdith JonesKatlyn BellamyJeannie MayberryMarge Swaim
Create random male first names
for i in range(10):rand_name = names.get_first_name(gender='male')print(rand_name)
returns
GeorgeShawnRobertStevenWilliamJamesChristopherJamesMichaelDonovan
Create random female first names
for i in range(10):rand_name = names.get_first_name(gender='female')print(rand_name)
returns
JessicaStephanieAnnEmmaHeatherAnnaKelliPaulineTanyaKathy
Create random last names
for i in range(10):rand_name = names.get_last_name()print(rand_name)
returns
SandersMeyerIngramStraightCaldwellCoxHudsonBassoMillhouseRivett
