-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
78 lines (73 loc) · 2.09 KB
/
main.py
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import names
import csv
import random
import pandas as pd
from faker import Faker
import datetime
fake = Faker()
# staff data
staffData = {
"firstNames__c": [],
"lastNames__c": [],
"phoneNumber__c": [],
"address__c": [],
"city__c": [],
"state__c": []
}
states = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
for i in range(150):
data = {
'Address__c': str(fake.address().splitlines()),
'City__c': str(fake.city()),
'Date_of_Birth__c': ''
}
try:
# add first name
firstName = names.get_first_name()
staffData["firstNames__c"].append(firstName)
except IndexError:
pass
try:
# add last name
lastName = names.get_last_name()
staffData["lastNames__c"].append(lastName)
except IndexError:
pass
try:
# add phone numbers
phoneNum = str(random.randint(1000000000, 9999999999))
staffData["phoneNumber__c"].append(phoneNum)
except IndexError:
pass
try:
# add address
address = fake.address().splitlines()
staffData["address__c"].append(address[0])
# add city
city = fake.city()
staffData["city__c"].append(city)
# add state
state = states[random.randint(0, 50)]
staffData["state__c"].append(state)
except IndexError:
pass
print(staffData)
df = pd.DataFrame(data=staffData)
print(df)
for i in df:
print(i)
# df.to_csv(
# r'C:\Users\matth\OneDrive\Documents\Marquette University\2021 Spring\Database Management Systems\Assingments\Final Project\staff_data.csv',
# index=False
# )
donationID = {
"donationID": [],
"donorID": [],
"staffID": [],
"date": [],
"amount": []
}