[Chennaipy] Chennaipy - Monday Module - 20 Jun 2022
selvi dct
selvi.dct at gmail.com
Mon Jun 20 00:40:53 EDT 2022
Date: 20 Jun 2022
Introduction: Whether you need to bootstrap your database, create
good-looking XML documents, fill-in your persistence to stress test it, or
anonymize data taken from a production service, Faker is for you.
Module: Faker
Installation: pip install Faker
About: Faker package helps to generate fake data, such as name, address,
text, color, date time, currencies, sentences, phone numbers and so on. To
ensure that all the generated values are unique for a specific function,
the .unique method is called. Instead, to generate the same value each
time, the seed() method is used.
Sample Source Code:
from faker import Faker
fake = Faker()
print("Name:", fake.name())
print("Address:", fake.address())
print("Email:", fake.email())
print("Phone Number:", fake.phone_number())
print("Company:", fake.company())
print("Text:", fake.text())
Execution:
$ python faker_sample.py
Output:
Name: Maria Miller
Address: 006 Melissa Radial
Emilyfort, MA 79709
Email: bradfordjacqueline at hotmail.com
Phone Number: (315)802-5718x3723
Company: Lopez-Estrada
Text: Site church style yeah truth before. Boy shoulder his man could.
Administration mouth create career difficult return speech. Mrs town
concern us.
Reference: https://pypi.org/project/Faker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/chennaipy/attachments/20220620/e83f4b26/attachment.html>
More information about the Chennaipy
mailing list