-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerator.py
More file actions
109 lines (92 loc) · 2.88 KB
/
generator.py
File metadata and controls
109 lines (92 loc) · 2.88 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import random
import json
import secrets
import string
from datetime import datetime
meses =(
"jan"
,
"feb"
,
"mar"
,
"apr"
,
"may"
,
"jun"
,
"jul"
,
"aug"
,
"sep"
,
"oct"
,
"nov"
,
"dec"
)
class ResourceGenerator:
@staticmethod
def generateCity() -> str:
with open('resources/us_cities.json') as json_file:
data = json.load(json_file)
cities = data["cities"]
random_index = random.randint(0, len(cities)-1)
return (data["cities"][random_index]["city"]).lower()
return "La Habana"
@staticmethod
def generatePass() -> str:
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in range(8))
password = "1A{}z*".format(password)
return password
@staticmethod
def generateOcuppation() -> str:
with open('resources/occupations.json') as json_file:
data = json.load(json_file)
occupations = data["occupations"]
random_index = random.randint(0, len(occupations)-1)
return (data["occupations"][random_index]).lower()
return "actor"
@staticmethod
def generateName() -> str:
with open('resources/firstNames.json') as json_file:
data = json.load(json_file)
occupations = data["firstNames"]
random_index = random.randint(0, len(occupations)-1)
return (data["firstNames"][random_index]).lower()
return "peter"
@staticmethod
def generateFriend() -> str:
return ResourceGenerator.generateName()
@staticmethod
def generateLastName():
with open('resources/lastNames.json') as json_file:
data = json.load(json_file)
occupations = data["lastNames"]
random_index = random.randint(0, len(occupations)-1)
return (data["lastNames"][random_index]).lower()
return "smith"
@staticmethod
def generateMail(name, lastName) -> str:
mail= name + lastName + str( random.randint(100, 999) ) + "@hotmail.com"
return mail
@staticmethod
def generateMailV() -> str:
name=generateName()
lastName=generateLastName()
generateMail(name,lastName)
return mail
@staticmethod
def generateDate() -> str:
# return str(random.randint(1, 28))+"_"+str(datetime.today().month)+"_"+str(random.randint(1970, 1999))
return str(random.randint(1, 15))+"_"+meses[random.randint(0, 11)]+"_"+str(random.randint(1970, 1999))
@staticmethod
def telef7Digit() -> str:
return str(random.randint(1000000, 9999999))
# for x in range(10):
# print("{}:{}:{}:{}:{}:{}".format(generateMail(), generatePass(),
# generateCity(),generateFriend(), generateOcuppation(), generateDate()))