https://github.com/nitor-infotech-oss/bulk-data-creation-accelerator
A component for test data generation using command line arguments that can be dynamically generated using custom excel file, default excel file or command line arguments. Extremely flexible and easy to use with limitless application use.
https://github.com/nitor-infotech-oss/bulk-data-creation-accelerator
data-generator faker python3
Last synced: 7 months ago
JSON representation
A component for test data generation using command line arguments that can be dynamically generated using custom excel file, default excel file or command line arguments. Extremely flexible and easy to use with limitless application use.
- Host: GitHub
- URL: https://github.com/nitor-infotech-oss/bulk-data-creation-accelerator
- Owner: nitor-infotech-oss
- Created: 2021-04-26T10:06:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-31T09:36:54.000Z (over 4 years ago)
- Last Synced: 2025-02-01T09:22:28.409Z (8 months ago)
- Topics: data-generator, faker, python3
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Data Generator Script
*********************This is a python script that is written in python version 3.6
This script generates random data with help of Faker library and generates 3 files \
that are (excel, csv and json) saved in output folder inside our project folder
An input data file is provided in input folder as an example of how input file should be formatted
Logs are maintained in LOGS.log filePrerequisites:
1. System must have python3.6
2. Install all the libraries required using command: pip/pip3 install -r requirements.txt
3. *.xlsx input file that consists of 2 columns:
i. fieldname : pass what output file's header value should be
ii. dataType : pass the data type required to generate output
(various data types are predefined in datatypes.py file)To run this application:
# count is iteration value to generate N number of records
# path is file path to determine input file format, this should be excel format
# default input file is provided in input folder as data.xlsx
# 3 output files will be generated according to following scenarios in output folder1. Without parameters: python3 main.py
Here count value is set default to 100 and an input data file will be considered from \
input folder's data.xlsx file2. With count parameter: python3 main.py count=N
Here count value is determined by Nth value e.g count=10 and an input data file \
will be considered from input folder's data.xlsx file3. With path parameter: python3 main.py path='file_path'
Here count value is set default to 100 and an input data file will be \
file_path from path parameter
4. With count and path parameter: python3 main.py count=N path='file_path'
Here count value is determined by Nth value and an input data file will be \
file_path from path parameter
5. With field and data type parameters:
python3 main.py FirstName first_name LastName last_name Email emailHere count value is set default to 100 and output data will generate based on \
parameter values; here all the parameters are divided into set of 2 parts \
and each part cosist of 2 values:
i. first value will be Header of output file
ii. second value will be value generated according to specified data type6. With count, field and data type parameters:
python3 main.py count=N FirstName first_nameHere count value is determined by Nth value and output data will generate based on \
parameter values7. With count, path, field and data type parameters:
python3 main.py count=N path='file_path' FirstName first_nameHere count value is determined by Nth value and output data will generate based on \
input file provided from path parameter and it will append extra field and data type \
passed in parametersNote : if default value is to be used for a specific field having same value for all records:
For excel:
append the value followed by 'value=' keyword in excel sheet's dataType column
e.g: value=XYZ or value=ABC DEF or value=18
For command line argument:
append the value followed by 'value=' keyword after specifying field name
e.g: Firstname value='XYZ' or Name value='ABC DEF' or Age value=18