Created
February 13, 2022 07:25
-
-
Save werterzz/c5b78b48ed243240d287c4b6c35161a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import csv | |
from faker import Faker | |
fake = Faker() | |
number_of_records = int(sys.argv[1]) | |
with open('random-person.csv', mode='w') as file: | |
file_writer = csv.writer(file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) | |
file_writer.writerow(['first_name', 'last_name', 'age']) | |
for _ in range(number_of_records): | |
file_writer.writerow([fake.first_name(), fake.last_name(), fake.numerify("@#")]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment