Skip to content

Data generation writen in rust. This generator will generate users, transaction, payment providers and user adresses.

Notifications You must be signed in to change notification settings

vesko-vujovic/dummy-data-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synthetic Data Generator

A versatile command-line tool written in Rust for generating synthetic data for testing and development purposes. The tool generates realistic-looking data for users, addresses, payment providers, and transactions in either JSON or CSV format.

Features

  • Generate synthetic data for:
    • Users (with names, emails, and phone numbers)
    • Addresses (linked to users)
    • Payment Providers
    • Transactions
  • Support for both JSON and CSV output formats
  • Auto-incrementing IDs with customizable starting point
  • Progress bars for visual feedback
  • Skewed data distribution option for realistic transaction patterns
  • Realistic fake data generation for names, addresses, and contact information
  • Configurable number of records for each entity type

Installation

  1. Make sure you have Rust and Cargo installed. If not, install from rustup.rs

  2. Clone the repository:

git clone [repository-url]
cd dummy-data-rust
  1. Add the following dependencies to your Cargo.toml:
[dependencies]
clap = { version = "4.0", features = ["derive"] }
fake = "2.5"
indicatif = "0.17"
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
csv = "1.2"
chrono = "0.4"
  1. Build the project:
cargo build --release

Usage

The basic command structure is:

cargo run -- [OPTIONS]

Command Line Options

Option Short Long Default Description
Users -u --users 100 Number of users to generate
Transactions -t --transactions 1000 Number of transactions to generate
Providers -p --providers 10 Number of payment providers to generate
Output Directory -o --output-dir "output" Directory where files will be saved
Format -f --format "json" Output format ("json" or "csv")
Start ID -i --start-id 1 Starting ID for auto-increment
Skewed -s --skewed false Enable skewed transaction distribution

Examples

  1. Generate default dataset in JSON format:
cargo run -- -u 100 -t 1000 -p 10
  1. Generate large dataset in CSV format:
cargo run -- -u 1000 -t 10000 -p 15 -f csv
  1. Generate data with custom starting ID:
cargo run -- -u 100 -t 1000 -p 10 -i 1000
  1. Generate data with skewed transaction distribution:
cargo run -- -u 100 -t 1000 -p 10 -s

Output Structure

The generator creates four files in your specified output directory:

Users File (users.json/users.csv)

{
  "id": 1,
  "name": "John Doe",

About

Data generation writen in rust. This generator will generate users, transaction, payment providers and user adresses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages