The Data Generator project provides a flexible and customizable way to generate random data for various use cases, such as testing, development, and simulation. The project leverages the DataFaker library to create realistic and diverse datasets. The current implementation includes generators for payment, aviation, StarGate, and StarWars data.
- Generate realistic data for various domains
- Easily extendable with new data templates
- Uses DataFaker for rich and varied data generation
- Outputs data in JSON format for easy integration
- Clone the repository:
git clone https://github.com/skodjob/data-generator.git
- Navigate to the project directory:
cd data-generator
- Build the project using Maven:
mvn clean install
<dependency>
<groupId>io.skodjob</groupId>
<artifactId>data-generator</artifactId>
</dependency>
To generate payment data, use the payment_data
template:
import io.skodjob.datagenerator.DataGenerator;
import io.skodjob.datagenerator.enums.ETemplateType;
public class Main {
public static void main(String[] args) {
DataGenerator dataGenerator = new DataGenerator(ETemplateType.PAYMENT_FIAT);
String paymentDataString = dataGenerator.generateData();
JsonNode paymentDataJson = dataGenerator.generateJsonData();
System.out.println(paymentDataString);
}
}
To generate flight data, use the flights
template:
import io.skodjob.datagenerator.DataGenerator;
import io.skodjob.datagenerator.enums.ETemplateType;
public class Main {
public static void main(String[] args) {
DataGenerator dataGenerator = new DataGenerator(ETemplateType.FLIGHTS);
String paymentDataString = dataGenerator.generateData();
JsonNode paymentDataJson = dataGenerator.generateJsonData();
System.out.println(paymentDataString);
}
}
To use different templates just change the input parameter for DataGenerator
and use it in the same way.
The project currently includes the following templates:
payment_data
flights
stargate
starwars
iot_device
payroll
Each template corresponds to a specific data domain and generates JSON data that can be used for various testing and development purposes.
Contributions are welcome! Please fork the repository and create a pull request with your changes. Ensure that your code follows the existing style and includes tests for new functionality.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
For any inquiries or issues, please open an issue on the GitHub repository.