Faker
Generate sample user data
from faker import Faker
fake = Faker()
print(fake.name()) # Generate fake user name
print(fake.email()) # Generate fake emailLast updated
Generate sample user data
from faker import Faker
fake = Faker()
print(fake.name()) # Generate fake user name
print(fake.email()) # Generate fake emailLast updated
from faker import Faker
fake = Faker() # Creating an instance/ object of the Faker class
print("Name:", fake.name()) # Generates a fake name
print("Email:", fake.email()) # Generates a fake email
print("Phone:", fake.phone_number()) # Generates a fake phone number
print("Address:", fake.address()) # Generates a fake address
print("Company:", fake.company()) # Generates a fake company name
print("Job Title:", fake.job()) # Generates a fake job title
print("Credit Card:", fake.credit_card_number()) # Generates a fake credit card number
print("IP Address:", fake.ipv4()) # Generates a fake IP address
#To generate it for lets say 10 users, use the following code:
from faker import Faker
fake = Faker() # Creating an instance of the Faker class
# Generate data for 10 users
for i in range(10):
print(f"User {i+1}:")
print("Name:", fake.name()) # Generates a fake name
print("Email:", fake.email()) # Generates a fake email
print("Phone:", fake.phone_number()) # Generates a fake phone number
print("Address:", fake.address()) # Generates a fake address
print("Company:", fake.company()) # Generates a fake company name
print("Job Title:", fake.job()) # Generates a fake job title
print("Credit Card:", fake.credit_card_number()) # Generates a fake credit card number
print("IP Address:", fake.ipv4()) # Generates a fake IP address
print("-" * 50) # Prints a separator line for better readability