Created
April 17, 2025 19:55
-
-
Save se7enack/c7c00acb453c9ae11b0b37208b453af8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from faker import Faker | |
import json | |
def uppercasewords(text): | |
return ' '.join(word.capitalize() for word in text.split()) | |
def makeuser(): | |
fake = Faker() | |
name = fake.name() | |
phonenumber = fake.numerify('(###) ###-####') | |
data = { | |
'full_name': name, | |
'email': name.replace(" ", ".").lower() + "@gmail.com", | |
'address': fake.address(), | |
'phone': phonenumber, | |
'job': uppercasewords(fake.job()), | |
'company': fake.company(), | |
'registered_date': fake.date_this_decade().isoformat() | |
} | |
json_string = json.dumps(data, indent=4) | |
return json_string | |
print(makeuser()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment