This Python script generates test data combinations based on predefined lists of values for each column. It can be useful for generating test data for automated testing, data analysis, or any other purposes where sample data is needed.
Clone the repository to your local machine:
Navigate to the directory containing the script and configuration file:
cd ~/generate_combination
Customize the config.json
file to specify the columns and lists of values for each data type.
Run the script using the following command:
python generate_combination.py config.json
Replace config.json
with the path to your customized configuration file.
The config.json
file contains the following parameters:
{
"parameters": {
"Name": ["John", "Alice", "Bob"],
"Age": [0, 4, 100],
"Height": [1.2, 3.2, 4.5]
},
"csv_path": "test_data.csv"
}
This configuration will generate test data combinations for the Name, Age, and Height columns using the specified lists of values.
Name,Age,Height
John,0,1.2
John,0,3.2
John,0,4.5
John,4,1.2
John,4,3.2
John,4,4.5
John,100,1.2
John,100,3.2
John,100,4.5
Alice,0,1.2
Alice,0,3.2
Alice,0,4.5
Alice,4,1.2
Alice,4,3.2
Alice,4,4.5
Alice,100,1.2
Alice,100,3.2
Alice,100,4.5
Bob,0,1.2
Bob,0,3.2
Bob,0,4.5
Bob,4,1.2
Bob,4,3.2
Bob,4,4.5
Bob,100,1.2
Bob,100,3.2
Bob,100,4.5
Need help? Open an issue in: ISSUES
Want to improve and add feature? Fork the repo, add your changes and send a pull request.