Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
codeperfectplus committed Sep 20, 2021
1 parent 0cf7af9 commit 96ca446
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 34 deletions.
79 changes: 46 additions & 33 deletions random_profile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,72 @@
'''
import random
fname = ['John', 'Jane', 'Corey', 'Travis', 'Dave', 'Kurt', 'Neil', 'Sam', 'Steve', 'Tom', 'James', 'Robert', 'Michael', 'Charles', 'Joe', 'Mary', 'Maggie', 'Nicole', 'Patricia', 'Linda', 'Barbara', 'Elizabeth', 'Laura', 'Jennifer', 'Maria','Adam','Sturt','Nikolson','Tom','Harry','Ruskin','Thor','Rocky','Ravid','David','Harris','Eion','Elon','Mark','Will','Chris']
lname = ['Smith', 'Doe', 'Jenkins', 'Robinson', 'Davis', 'Stuart', 'Jefferson', 'Jacobs', 'Wright', 'Patterson', 'Wilks', 'Arnold', 'Johnson', 'Williams', 'Jones', 'Brown', 'Davis', 'Miller', 'Wilson', 'Moore', 'Taylor', 'Anderson', 'Thomas', 'Jackson', 'White', 'Harris', 'Martin','Potter','Jukerberg','Smith','Nebula','Downy','Downy Jr']
street_names = ['Main', 'High', 'Pearl', 'Maple', 'Park', 'Oak', 'Pine', 'Cedar', 'Elm', 'Washington', 'Lake', 'Hill']
fake_cities = ['Metropolis', 'Eerie', "King's Landing", 'Sunnydale', 'Bedrock', 'South Park', 'Atlantis', 'Mordor', 'Olympus', 'Dawnstar', 'Balmora', 'Gotham', 'Springfield', 'Quahog', 'Smalltown', 'Epicburg', 'Pythonville', 'Faketown', 'Westworld', 'Thundera', 'Vice City', 'Blackwater', 'Oldtown', 'Valyria', 'Winterfell', 'Braavos‎', 'Lakeview']
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']
fname = ['John', 'Jane', 'Corey', 'Travis', 'Dave', 'Kurt', 'Neil', 'Sam', 'Steve', 'Tom', 'James', 'Robert', 'Michael', 'Charles', 'Joe', 'Mary', 'Maggie', 'Nicole', 'Patricia', 'Linda', 'Barbara', 'Elizabeth', 'Laura',
'Jennifer', 'Maria', 'Adam', 'Sturt', 'Nikolson', 'Tom', 'Harry', 'Ruskin', 'Thor', 'Rocky', 'Ravid', 'David', 'Harris', 'Eion', 'Elon', 'Mark', 'Will', 'Chris', 'Laura', 'Samara', 'Darren', 'Jim', 'Jeremy', 'Dylan', 'Jake', 'Patti', 'Paget', 'Mira', 'Maude', 'Katie', 'Rob',
'Brian', 'Kerry', 'Chad', 'Nicola']

lname = ['Smith', 'Doe', 'Jenkins', 'Robinson', 'Davis', 'Stuart', 'Jefferson', 'Jacobs', 'Wright', 'Patterson', 'Wilks', 'Arnold', 'Johnson', 'Williams', 'Jones', 'Brown',
'Davis', 'Miller', 'Wilson', 'Moore', 'Taylor', 'Anderson', 'Thomas', 'Jackson', 'White', 'Harris', 'Martin', 'Potter', 'Jukerberg', 'Smith', 'Nebula', 'Downy', 'Downy Jr',
'Brewster', 'Amberg', 'Kaye', 'Harrier', 'Criss', 'Parsons', 'McDermott', 'Picking', 'Hudson']

street_names = ['Main', 'High', 'Pearl', 'Maple', 'Park',
'Oak', 'Pine', 'Cedar', 'Elm', 'Washington', 'Lake', 'Hill']

fake_cities = ['Metropolis', 'Eerie', "King's Landing", 'Sunnydale', 'Bedrock', 'South Park', 'Atlantis', 'Mordor', 'Olympus', 'Dawnstar', 'Balmora', 'Gotham', 'Springfield',
'Quahog', 'Smalltown', 'Epicburg', 'Pythonville', 'Faketown', 'Westworld', 'Thundera', 'Vice City', 'Blackwater', 'Oldtown', 'Valyria', 'Winterfell', 'Braavos‎', 'Lakeview']

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']


class RandomProfile:
def __init__(self,num=1):
def __init__(self, num=1):
'''
num = Total No. of Name You Want To Print
deafult is 1
To Print More Than one Name Change value of num
'''
'''
self.num = num

def first_name(self):
# print first name
first_name_list = [random.choice(fname) for _ in range(self.num)]
return first_name_list

def last_name(self):
#print last name
# print last name
last_name_list = [random.choice(lname) for _ in range(self.num)]
return last_name_list

def full_name(self):
#print full name
full_name_list = [random.choice(fname) + ' ' + random.choice(lname) for _ in range(self.num)]
# print full name
full_name_list = [random.choice(
fname) + ' ' + random.choice(lname) for _ in range(self.num)]
return full_name_list

def full_profile(self):
#print full profile
# print full profile
profile_list = []
for i in range(self.num):
first = random.choice(fname)
last = random.choice(lname)
phone = f'+ +1-{random.randint(300, 600)}{random.randint(800, 999)}{random.randint(1000,9999)}'
for _ in range(self.num):
first = random.choice(fname)
last = random.choice(lname)
phone = f'+ +1-{random.randint(300, 500)}{random.randint(800, 999)}{random.randint(1000,9999)}'

street_num = random.randint(100, 999)
street = random.choice(street_names)
city = random.choice(fake_cities)
state = random.choice(states)
zip_code = random.randint(10000, 99999)

address = f'{street_num} {street} St. {city} {state} {zip_code}'
email = first.lower() + last.lower() + '@bogusemail.com'

street_num = random.randint(100, 999)
street = random.choice(street_names)
city = random.choice(fake_cities)
state = random.choice(states)
zip_code = random.randint(10000, 99999)

address = f'{street_num} {street} St. {city} {state} {zip_code}'
email = first.lower() + last.lower() + '@bogusemail.com'
profile_dict = {}
profile_dict['first_name'] = first
profile_dict['last_name'] = last
profile_dict['phone'] = phone
profile_dict['address'] = address
profile_dict['email'] = email
profile_list.append(profile_dict)

profile_dict = {}
profile_dict['first_name'] = first
profile_dict['last_name'] = last
profile_dict['phone'] = phone
profile_dict['address'] = address
profile_dict['email'] = email
profile_list.append(profile_dict)

return profile_list
return profile_list
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
name="random_profile",

#version of the module
version="0.0.9",
version="0.1.0",

#Name of Author
author="CodePerfectPlus",
Expand Down

0 comments on commit 96ca446

Please sign in to comment.