Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Generate a CSV with information for 50,000 fake persons
import mimesis
import csv
import random
person = mimesis.Personal(locale='en')
with open('persons.csv', mode='w', newline='\n') as person_file:
writer = csv.writer(person_file)
# Header Row
writer.writerow(['Full Name', 'Age', 'Occupation', 'Email', 'Telephone',
'Nationality'])
for i in range(0, 50000):
rando = random.uniform(0, 1)
if rando >= 0.5:
gender = 'female'
else:
gender = 'male'
row = [
import mimesis
import csv
import random
import json
import gzip
person = mimesis.Personal(locale='en')
rows = []
for i in range(0, 100000):
rando = random.uniform(0, 1)
if rando >= 0.5:
gender = 'female'
else:
gender = 'male'
rows.append({
'full_name': person.full_name(gender=gender),
'nationality': person.nationality(),
'occupation': person.occupation(),
'personal': {
'age': person.age(),
'gender': gender,
# Generate a CSV with information for 50,000 fake persons
import mimesis
import csv
import random
import json
person = mimesis.Personal(locale='en')
rows = []
for i in range(0, 50000):
rando = random.uniform(0, 1)
if rando >= 0.5:
gender = 'female'
else:
gender = 'male'
rows.append({
'full_name': person.full_name(gender=gender),
'age': person.age(),
'occupation': person.occupation(),
'gender': person.email(gender=gender),
'telephone': person.telephone(),
'nationality': person.nationality()
def personal(locale):
"""
:param locale:
:return:
"""
return Personal(locale)
def _mname():
person = mimesis.Personal(locale='en')
return person.full_name()
# Generate a CSV with information for 50,000 fake persons
import mimesis
import csv
import random
person = mimesis.Personal(locale='en')
with open('persons.csv', mode='w', newline='\n', encoding='utf-8') as person_file:
writer = csv.writer(person_file)
# Header Row
writer.writerow(['Full Name', 'Age', 'Occupation', 'Email', 'Telephone',
'Nationality'])
for i in range(0, 50000):
rando = random.uniform(0, 1)
if rando >= 0.5:
gender = 'female'
else:
gender = 'male'
row = [