-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-generate.py
More file actions
51 lines (43 loc) · 2.63 KB
/
data-generate.py
File metadata and controls
51 lines (43 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import csv
import random
from datetime import datetime, timedelta
# 75 unique first names
first_names = [
"Aaron","Abel","Abigail","Adam","Adrian","Aiden","Alan","Albert","Alex","Alexander",
"Alice","Alicia","Allan","Amelia","Amy","Andrea","Andrew","Angela","Anna","Anthony",
"Arthur","Ashley","Austin","Barbara","Benjamin","Betty","Beverly","Blake","Brandon","Brian",
"Brianna","Bruce","Bryan","Caleb","Cameron","Carl","Carol","Caroline","Catherine","Charles",
"Charlotte","Cheryl","Christian","Christina","Christopher","Claire","Clara","Colin","Connor","Craig",
"Daisy","Daniel","Danielle","David","Deborah","Dennis","Diana","Diane","Dominic","Donna",
"Dylan","Edward","Elizabeth","Emily","Emma","Eric","Ethan","Evelyn","Felix","Fiona",
"Francis","Frank","Gabriel","Gavin","George","Grace","Hannah"
]
# 75 unique last names
last_names = [
"Adams","Allen","Anderson","Bailey","Baker","Barnes","Bell","Bennett","Brooks","Brown",
"Bryant","Campbell","Carter","Clark","Collins","Cook","Cooper","Cox","Davis","Diaz",
"Edwards","Evans","Flores","Foster","Garcia","Gonzalez","Gray","Green","Griffin","Hall",
"Harris","Hayes","Henderson","Hernandez","Hill","Howard","Hughes","Jackson","James","Jenkins",
"Johnson","Jones","Kelly","King","Lee","Lewis","Long","Lopez","Martin","Martinez",
"Miller","Mitchell","Moore","Morgan","Murphy","Nelson","Parker","Perez","Perry","Peterson",
"Powell","Price","Ramirez","Reed","Richardson","Rivera","Roberts","Robinson","Rodriguez","Ross",
"Sanchez","Scott","Smith","Stewart","Taylor","Thomas","Thompson","Torres","Turner","Walker",
"Ward","Washington","Watson","White","Williams","Wilson","Wood"
]
records = 5000
output_file = "data.csv"
# Shuffle the combinations to avoid sequential patterns
combinations = [(f, l) for f in first_names for l in last_names]
random.shuffle(combinations)
with open(output_file, mode='w', newline='') as file:
writer = csv.writer(file)
writer.writerow(["id", "name", "ssn", "dob", "card", "exp"]) # header
for i in range(records):
first, last = combinations[i]
name = f"{first} {last}"
ssn = f"{random.randint(100,999)}-{random.randint(10,99)}-{random.randint(1000,9999)}"
dob = f"{(datetime.now() - timedelta(days=random.randint(0, 80*365))).strftime('%m-%d-%Y')}"
card = f"{random.randint(1000,9999)}-{random.randint(1000,9999)}-{random.randint(1000,9999)}-{random.randint(1000,9999)}"
exp = f"{(datetime.now() + timedelta(days=random.randint(1, 730))).strftime('%m/%Y')}"
writer.writerow([i + 1, name, ssn, dob, card, exp])
print(f"Generated {records} records in {output_file}")