mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-27 14:01:12 +00:00
Added fake data generator script
This commit is contained in:
parent
39c5ae4495
commit
23343f5c60
22
scripts/Fake Data Generator/generator.py
Normal file
22
scripts/Fake Data Generator/generator.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# pip install Faker
|
||||
from faker import Faker
|
||||
|
||||
fake = Faker()
|
||||
|
||||
print("--------- Generate ---------------")
|
||||
print("1. Name")
|
||||
print("2. Email")
|
||||
print("3. Job")
|
||||
print("4. Address")
|
||||
|
||||
options = {1: fake.name(), 2: fake.email(), 3: fake.job(), 4: fake.address()}
|
||||
|
||||
print("----------------------------------")
|
||||
user_input = int(input("Choose Option:- "))
|
||||
|
||||
print("----------------------------------")
|
||||
|
||||
if user_input in options:
|
||||
print(f"Result: {options[user_input]}")
|
||||
else:
|
||||
print("Please try again with a valid option.")
|
15
scripts/Fake Data Generator/readme.md
Normal file
15
scripts/Fake Data Generator/readme.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
# Fake Data Generator
|
||||
super easy and simple python script to generate random data
|
||||
|
||||
## Perfect for beginners
|
||||
- usage of libraries
|
||||
- working with input
|
||||
- working with dictionaries
|
||||
|
||||
## Installation
|
||||
Install the dependencies
|
||||
|
||||
```sh
|
||||
pip install -r requirements.txt
|
||||
```
|
3
scripts/Fake Data Generator/requirements.txt
Normal file
3
scripts/Fake Data Generator/requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Faker==15.0.0
|
||||
python-dateutil==2.8.2
|
||||
six==1.16.0
|
Loading…
Reference in New Issue
Block a user