← 返回
未分类 中文

Generate

Generate random test data including text, numbers, UUIDs, and structured formats. Use when creating mock datasets, sample records, or randomized test inputs.
生成随机测试数据,包括文本、数字、UUID和结构化格式。适用于创建模拟数据集、示例记录或随机化测试输入。
bytesagain3
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 527
下载
💾 4
安装
1
版本
#latest

概述

Generate — Universal Data Generator

A versatile CLI tool for generating random data of various types. Produce text, numbers, UUIDs, dates, names, emails, addresses, and structured formats like JSON and CSV for testing and development.

Prerequisites

  • Python 3.8+
  • bash shell
  • Write access to ~/.generate/

Data Storage

Generated data history is stored in JSONL format at ~/.generate/data.jsonl. Each generation event is logged for reproducibility and batch export.

Commands

Run commands via: bash scripts/script.sh [arguments...]

text

Generate random text strings: lorem ipsum, sentences, paragraphs, or custom patterns.

bash scripts/script.sh text --type lorem --words 50
bash scripts/script.sh text --type sentence --count 5
bash scripts/script.sh text --type paragraph --count 2

Arguments:

  • --type — Text type: lorem, sentence, paragraph, word (optional, default: lorem)
  • --words — Number of words for lorem (optional, default: 20)
  • --count — Number of items to generate (optional, default: 1)

number

Generate random numbers with configurable range and format.

bash scripts/script.sh number --min 1 --max 100
bash scripts/script.sh number --min 0.0 --max 1.0 --decimal 4
bash scripts/script.sh number --count 10 --min 1 --max 1000

Arguments:

  • --min — Minimum value (optional, default: 0)
  • --max — Maximum value (optional, default: 100)
  • --decimal — Decimal places for float (optional, generates int if omitted)
  • --count — How many numbers (optional, default: 1)

uuid

Generate one or more UUIDs (v4).

bash scripts/script.sh uuid
bash scripts/script.sh uuid --count 5
bash scripts/script.sh uuid --format short

Arguments:

  • --count — Number of UUIDs (optional, default: 1)
  • --format — Format: full, short (8-char) (optional, default: full)

date

Generate random dates within a range.

bash scripts/script.sh date --start 2020-01-01 --end 2025-12-31
bash scripts/script.sh date --count 10 --format iso

Arguments:

  • --start — Start date YYYY-MM-DD (optional, default: 2020-01-01)
  • --end — End date YYYY-MM-DD (optional, default: 2025-12-31)
  • --count — Number of dates (optional, default: 1)
  • --format — Date format: iso, us, eu, unix (optional, default: iso)

name

Generate random person names.

bash scripts/script.sh name
bash scripts/script.sh name --count 10 --gender female
bash scripts/script.sh name --full

Arguments:

  • --count — Number of names (optional, default: 1)
  • --gender — Gender: male, female, any (optional, default: any)
  • --full — Include last name (optional)

email

Generate random email addresses.

bash scripts/script.sh email
bash scripts/script.sh email --count 5 --domain example.com

Arguments:

  • --count — Number of emails (optional, default: 1)
  • --domain — Email domain (optional, default: random)

address

Generate random US-style addresses.

bash scripts/script.sh address
bash scripts/script.sh address --count 3

Arguments:

  • --count — Number of addresses (optional, default: 1)

json

Generate random JSON objects with a specified schema.

bash scripts/script.sh json --schema '{"name":"name","age":"int:18-65","email":"email"}'
bash scripts/script.sh json --schema '{"id":"uuid","score":"float:0-100"}' --count 5

Arguments:

  • --schema — JSON schema definition (required)
  • --count — Number of objects (optional, default: 1)

csv

Generate random CSV data with headers.

bash scripts/script.sh csv --columns "name,email,age" --rows 20
bash scripts/script.sh csv --columns "id:uuid,name:name,score:float:0-100" --rows 50 --output data.csv

Arguments:

  • --columns — Column definitions (required)
  • --rows — Number of rows (optional, default: 10)
  • --output — Output file (optional, default: stdout)

password

Generate random passwords with configurable complexity.

bash scripts/script.sh password
bash scripts/script.sh password --length 24 --count 5
bash scripts/script.sh password --no-special --length 16

Arguments:

  • --length — Password length (optional, default: 16)
  • --count — Number of passwords (optional, default: 1)
  • --no-special — Exclude special characters (optional)

batch

Run multiple generation commands in batch from a config file.

bash scripts/script.sh batch --config batch.json

Arguments:

  • --config — Batch configuration file (required)

help

Display help information and list all available commands.

bash scripts/script.sh help

version

Display the current tool version.

bash scripts/script.sh version

Examples

# Generate 100 user records as CSV
bash scripts/script.sh csv --columns "id:uuid,name:name,email:email,age:int:18-65" --rows 100 --output users.csv

# Create JSON test data
bash scripts/script.sh json --schema '{"user":"name","score":"float:0-100"}' --count 20

# Quick password generation
bash scripts/script.sh password --length 20 --count 10

Notes

  • All generated data is logged in ~/.generate/data.jsonl for reproducibility
  • Use --seed (where supported) for deterministic output
  • Schema types for JSON/CSV: name, email, uuid, int:min-max, float:min-max, bool, date, string
  • Batch mode accepts a JSON config with an array of generation commands

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 16:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Thesis Helper

bytesagain3
论文写作助手。论文大纲生成、文献综述框架、摘要生成、引用格式转换、格式规范检查、答辩准备。Thesis helper with outline generation, literature review, abstract writing,
★ 1 📥 3,502
data-analysis

Database Design

bytesagain3
数据库设计助手。表设计、范式化、索引策略、迁移脚本、测试数据、ER图描述。Database designer with normalization, indexing, migration, seeding, ER diagrams. 数据
★ 2 📥 2,600
content-creation

Taobao Listing

bytesagain3
淘宝商品文案。宝贝标题、详情页文案、主图文案、促销活动、关键词挖掘、大促文案。Taobao listing generator with product titles, detail pages, keyword mining, promo
★ 0 📥 2,259