Skip to content

Commit

Permalink
Fix formatting issues in RandomProfile class and update docstrings fo…
Browse files Browse the repository at this point in the history
…r clarity
  • Loading branch information
codeperfectplus committed Jan 4, 2025
1 parent 9e22ac9 commit 0415b91
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions random_profile/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
job_titles = utils.load_txt_file(job_titles_txt)
job_levels = utils.load_txt_file(job_levels_txt)


class RandomProfile:
"""
Random Profile Generator
Expand Down Expand Up @@ -138,7 +139,7 @@ def height_weight(self, num: int = None) -> List[Tuple[int, int]]:

def generate_address(self, num: int = None) -> List[dict]:
"""
Generate one or more addresses.
Generate one or more addresses.
Returns a list of dictionaries with address components.
"""
count = self.num if num is None else num
Expand Down Expand Up @@ -204,15 +205,15 @@ def full_names(self, num: int = None, gender: Gender = None) -> List[str]:

def full_profiles(self, num: int = None, gender: Gender = None) -> List[dict]:
"""
Generate one or more full profiles.
Generate one or more full profiles.
Each profile is a dictionary containing various personal details.
"""
count = self.num if num is None else num
profile_list = []

for _ in range(count):
this_gender = utils.generate_random_gender() if gender is None else gender

# Generate names
f_name = random.choice(fname_male if this_gender.value == Gender.MALE.value else fname_female)
l_name = random.choice(lname)
Expand All @@ -221,7 +222,7 @@ def full_profiles(self, num: int = None, gender: Gender = None) -> List[dict]:
# Generate personal data
hair = random.choice(hair_colors)
blood = random.choice(blood_types)
phone_number = f"+1-{random.randint(300, 500)}-{random.randint(800, 999)}-{random.randint(1000,9999)}"
phone_number = f"+1-{random.randint(300, 500)}-{random.randint(800, 999)}-{random.randint(1000, 9999)}"
dob, age = utils.generate_dob_age()
height, weight = utils.generate_random_height_weight()
job_experience = utils.generate_random_job_level(age, job_levels)
Expand Down Expand Up @@ -277,4 +278,4 @@ def full_profiles(self, num: int = None, gender: Gender = None) -> List[dict]:

profile_list.append(profile)

return profile_list
return profile_list

0 comments on commit 0415b91

Please sign in to comment.