You can download this code by clicking the button below.
This code is now available for download.
This function uses the Person and Address modules from the Mimesis library to generate random personal information, including first name, last name, full name, email, phone number, and address.
Technology Stack : Mimesis library, Python programming
Code Type : Function
Code Difficulty : Intermediate
import random
from mimesis import Person, Address
def generate_random_person_data():
# Generate a random person's data
first_name = Person.first_name()
last_name = Person.last_name()
full_name = f"{first_name} {last_name}"
email = Person.email()
phone_number = Person.phone()
address = Address.street()
return {
"first_name": first_name,
"last_name": last_name,
"full_name": full_name,
"email": email,
"phone_number": phone_number,
"address": address
}
# Code Information