|
15 | 15 |
|
16 | 16 | from random_profile.utils import ipv4_gen |
17 | 17 | from random_profile.utils import load_txt_file |
18 | | -from random_profile.utils import genrate_dob_age |
19 | | -from random_profile.utils import genrate_random_height_weight |
| 18 | +from random_profile.utils import generate_dob_age |
| 19 | +from random_profile.utils import generate_random_height_weight |
20 | 20 |
|
21 | 21 | ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
22 | 22 |
|
@@ -50,36 +50,42 @@ def __init__(self, num=1): |
50 | 50 | ''' |
51 | 51 | self.num = num |
52 | 52 |
|
53 | | - def first_name(self): |
54 | | - # print first name |
55 | | - first_name_list = [random.choice(fname) for _ in range(self.num)] |
| 53 | + def first_name(self, num=None): |
| 54 | + if num is None: |
| 55 | + num = self.num |
| 56 | + first_name_list = [random.choice(fname) for _ in range(num)] |
56 | 57 | return first_name_list |
57 | 58 |
|
58 | | - def last_name(self): |
59 | | - # print last name |
60 | | - last_name_list = [random.choice(lname) for _ in range(self.num)] |
| 59 | + def last_name(self, num=None): |
| 60 | + if num is None: |
| 61 | + num = self.num |
| 62 | + last_name_list = [random.choice(lname) for _ in range(num)] |
61 | 63 | return last_name_list |
62 | 64 |
|
63 | | - def full_name(self): |
64 | | - # print full name |
| 65 | + def full_name(self, num=None): |
| 66 | + if num is None: |
| 67 | + num = self.num |
65 | 68 | full_name_list = [random.choice( |
66 | | - fname) + ' ' + random.choice(lname) for _ in range(self.num)] |
| 69 | + fname) + ' ' + random.choice(lname) for _ in range(num)] |
67 | 70 | return full_name_list |
68 | 71 |
|
69 | | - def full_profile(self): |
| 72 | + def full_profile(self, num=None): |
| 73 | + if num is None: |
| 74 | + num = self.num |
70 | 75 | profile_list = [] |
71 | | - for _ in range(self.num): |
| 76 | + for _ in range(num): |
72 | 77 | first = random.choice(fname) |
73 | 78 | last = random.choice(lname) |
74 | 79 | hair_color = random.choice(hair_colors) |
75 | 80 | blood_type = random.choice(blood_types) |
76 | 81 | full_name = first + ' ' + last |
77 | | - phone = f'+ +1-{random.randint(300, 500)}-{random.randint(800, 999)}-{random.randint(1000,9999)}' |
| 82 | + phone = f'+1-{random.randint(300, 500)}-{random.randint(800, 999)}-{random.randint(1000,9999)}' |
78 | 83 | job_title = random.choice(job_titles) |
79 | 84 | ip_address = ipv4_gen() |
80 | 85 | email_domain = random.choice(email_domains) |
81 | | - dob, age = genrate_dob_age() |
82 | | - height, weight = genrate_random_height_weight() |
| 86 | + |
| 87 | + dob, age = generate_dob_age() |
| 88 | + height, weight = generate_random_height_weight() |
83 | 89 |
|
84 | 90 | street_num = random.randint(100, 999) |
85 | 91 | street = random.choice(street_names) |
|
0 commit comments