generate 150 different job_titles, 150 requirements, 150 experience, 150 job roles, 150 salary of job, 150 time of work and location , 150 different comapnies, details more of 150 using python ?
Assistant
Certainly! I'll provide you with a basic Python script to generate this information. Since generating 150 unique entries manually here would be extensive, I'll simulate the generation using randomization. You'll need the faker library to create realistic-sounding data; if not installed, use pip install faker.
Here's a script to get you started:
python
import random
from faker import Faker
fake = Faker()
def generate_job_titles(n=150):
job_titles = set()
while len(job_titles) < n:
job_titles.add(fake.job())
return list(job_titles)
def generate_requirements(n=150):
requirements = []
skills = ["Python", "SQL", "Excel", "JavaScript", "Management", "Leadership",
"Communication", "Teamwork", "AWS", "Machine Learning", "Project Management"]
for _ in range(n):
num_skills = random.randint(3, 5)
requirement = ', '.join(random.sample(skills, num_skills))
requirements.append(f"Experience in {requirement}")
return requirements
def generate_experience(n=150):
experience_levels = ["Entry-level", "Mid-level", "Senior-level", "Internship", "Director"]
return [random.choice(experience_levels) for _ in range(n)]
def generate_job_roles(n=150):
roles = []
for _ in range(n):
role_desc = (f"Responsible for {fake.bs()}, and ensuring {fake.bs()}. "
f"Oversee {fake.bs()} and support team members with {fake.bs()}.")
roles.append(role_desc)
return roles
def generate_salary(n=150):
return [f"${random.randint(50, 150)}k per year" for _ in range(n)]
def generate_time_and_location(n=150):
work_time = ["Full-time", "Part-time", "Contract", "Temporary", "Internship"]
locations = [fake.city() for _ in range(n)]
time_location = []
for i in range(n):
time_location.append(f"{random.choice(work_time)}, {locations[i]}")
return time_location
def generate_companies(n=150):
companies = set()
while len(companies) < n:
companies.add(fake.company())
return list(companies)
# Generate data
job_titles = generate_job_titles()
requirements = generate_requirements()
experience = generate_experience()
job_roles = generate_job_roles()
salaries = generate_salary()
time_and_location = generate_time_and_location()
companies = generate_companies()
# Print first 5 examples as a sample
for i in range(5):
print(f"Job Title: {job_titles[i]}")
print(f"Requirements: {requirements[i]}")
print(f"Experience: {experience[i]}")
print(f"Job Role: {job_roles[i]}")
print(f"Salary: {salaries[i]}")
print(f"Time and Location: {time_and_location[i]}")
print(f"Company: {companies[i]}")
print("="*40)
How to Run:
Make sure you have Python installed.
Install the faker library: pip install faker.
Copy and paste the code into a .py file.
Run the script by executing python your_script.py.
This script will simulate the generation of job-related data across various fields, providing an overview for 150 entries. Adjust the set of skills, job titles, and other data as needed to better match real-world scenarios or specific needs.