randata

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

README ΒΆ

randata

Build Status Release Go version License

Randomly generate data and export it to various formats (csv, jsonl). Useful for populating databases, testing algorithms, and generating massive mock datasets on the fly.

πŸš€ Features

  • Blazing Fast: Written in Go, it generates thousands of records in milliseconds.
  • Multiple Formats: Export directly to CSV or JSON Lines (JSONL).
  • Customizable Fields: Use predefined types (names, addresses, emails) or build your own custom formats using wildcards.
  • Append Mode: Continuously append new data to existing files seamlessly.

πŸ“¦ Installation

Download Binaries

You can download the pre-compiled binaries for your OS (Windows, macOS, Linux) directly from the Releases page.

Using go install

If you have Go installed:

go install github.com/BenjaminGuzman/randata@latest

πŸ’» Usage

randata [flags]
Options
Flag Description Default
--count Number of random records (rows) to generate. 100
--format Output format (csv, jsonl). Inferred from extension if empty. Inferred
--out Output file path. data.csv
--mode How to update the output file (overwrite, append). overwrite
--fields Comma separated fields to project. ALL
--version Prints the current version.
Custom Fields

If you need a field that is not one of the pre-defined ones, provide its name followed by its format separated by a colon, e.g. customField:### ??**. Available wildcards:

  • ?: Random letter
  • #: Random digit
  • *: Random ASCII char (between 32 space and 126 tilde)

Check the full list of pre-defined columns in generator.go.

πŸ’‘ Examples

Generate a CSV with 1,000 records containing a last name, password, 5-digit zip code, and a custom sample field:

randata --out data.csv --count 1000 --fields "lastName,password,zip:#####,sample:letter? ascii* number#"

Generated output (data.csv):

lastName,password,zip,sample
Reilly,{dkfndo{gbmhd|,89329,letterq asciiK number9
Ruecker,bd}rnv|vv,39090,letterk asciiU number5
McClure,fshy{kor,09436,letterc ascii< number1
Weimann,ejelxlauly,51831,lettera ascii0 number8
Murazik,b~ftnbiqk{xkjbxu,73276,lettero asciio number9

πŸ› οΈ Development

We use make to automate common tasks:

  • make build: Compile the binary.
  • make test: Run unit tests with coverage.
  • make lint: Run golangci-lint.

πŸ“„ License

GPLv3

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL