diff --git a/Fake_Data_Generator/README.md b/Fake_Data_Generator/README.md new file mode 100644 index 00000000..a3d5c145 --- /dev/null +++ b/Fake_Data_Generator/README.md @@ -0,0 +1,15 @@ +# Fake Data Generator +A python script that creates a fake identity +- First Name +- Last Name +- Email +- Phone number +- City +- Street name +- Street address +- Zip Code +- State +- Country +- Job title +- Years of experience +- Salary diff --git a/Fake_Data_Generator/main.py b/Fake_Data_Generator/main.py new file mode 100644 index 00000000..9c7e2648 --- /dev/null +++ b/Fake_Data_Generator/main.py @@ -0,0 +1,56 @@ +import random +import requests +import json + +email_endings = ['@gmail.com', '@yahoo.com', '@hotmail.com', '@outlook.com', '@icloud.com'] + +random_data_generator_url = "https://random-data-api.com/api/v2/users?size=1&is_xml=true" +response = requests.get(random_data_generator_url) +data = json.loads(response.text) + +#Name +first_name = data['first_name'] +last_name = data['last_name'] + +#Email +email = data['email'].split("@") +email_numbering = [str(random.randint(1, 1000)), ""] +email = email[0] + random.choice(email_numbering) + random.choice(email_endings) +dot_or_underscore = random.choice([0, 1]) +if dot_or_underscore == 1: + email = email.replace(".", "_") + +#Phone +phone_number = data['phone_number'] +if phone_number.count("x") != 0: + phone_number = phone_number.split("x", 1)[0] + +#City +city = data['address']['city'] + +#Street Name +street_name = data['address']['street_name'] + +#Street Address +street_address = data['address']['street_address'] + +#Zip code +zip_code = data['address']['zip_code'] + +#State +state = data['address']['state'] + +#Country +country = data['address']['country'] + +#Job Title +job_title = data['employment']['title'] + +#years of experience +years_of_experience = random.choice(['1', '2', '3', '4', '5+']) + +#Salary +salary = random.randrange(50000, 250000, 500) + +data = (first_name, last_name, email, phone_number, city, street_name, street_address, zip_code, state, country, job_title, years_of_experience, salary) +print(data) \ No newline at end of file diff --git a/Fake_Data_Generator/requirements.txt b/Fake_Data_Generator/requirements.txt new file mode 100644 index 00000000..54ed1da6 --- /dev/null +++ b/Fake_Data_Generator/requirements.txt @@ -0,0 +1,2 @@ +numpy==1.23.2 +pandas==1.4.3