From fee04786c7ba036c6b98e449db7f50abdb9a93e4 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 22 Mar 2026 19:45:23 +0000 Subject: [PATCH] Initial upload: testdata-cli with CI/CD workflow --- README.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8823584..54672b0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,114 @@ -# testdata-cli +# TestData CLI -A CLI tool that generates realistic test data from JSON Schema, TypeScript types, or sample data files using Faker-style generation. \ No newline at end of file +A CLI tool that generates realistic test data from JSON Schema, TypeScript types, or sample data files using Faker-style generation. + +## Features + +- Generate realistic test data from JSON Schema +- Support for Faker-style data generation (names, emails, addresses, dates) +- Bulk data generation with configurable count +- Multiple output formats: JSON, CSV, and SQL +- Generate from TypeScript types +- Generate from sample data files +- Custom pattern support with regex-based generation +- Seed support for reproducible data generation + +## Installation + +```bash +pip install testdata-cli +# or +pip install -e . +``` + +## Quick Start + +Generate data from a JSON Schema file: + +```bash +testdatagen generate --schema schema.json --count 10 +``` + +Generate with specific output format: + +```bash +testdatagen generate --schema schema.json --format csv --count 5 +``` + +Use a seed for reproducible results: + +```bash +testdatagen generate --schema schema.json --seed 12345 +``` + +## Commands + +### generate + +Generate test data from a JSON Schema file. + +```bash +testdatagen generate --schema [options] +``` + +Options: +- `--schema`, `-s`: Path to JSON Schema file (required) +- `--count`, `-n`: Number of records to generate (default: 10) +- `--format`, `-f`: Output format - json, csv, or sql (default: json) +- `--seed`: Random seed for reproducibility +- `--table`: Table name for SQL output (default: generated_table) + +### from-ts + +Generate test data from a TypeScript type definition. + +```bash +testdatagen from-ts --input [options] +``` + +### from-sample + +Generate test data from a sample data file. + +```bash +testdatagen from-sample --input [options] +``` + +## Configuration + +Default options can be configured in `~/.testdatagen.yaml`: + +```yaml +default-seed: 42 +default-count: 10 +``` + +Or in `pyproject.toml`: + +```toml +[tool.testdatagen] +default-seed = 42 +default-count = 10 +``` + +## Schema Reference + +### Supported Types + +| JSON Schema Type | Faker Generation | +|-----------------|------------------| +| string (email format) | fake.email() | +| string (date-time format) | fake.date_time() | +| string (uuid format) | fake.uuid4() | +| string (uri format) | fake.uri() | +| string (with pattern) | Pattern-based generation | +| integer | fake.random_int() | +| number | fake.pyfloat() | +| boolean | fake.pybool() | +| object | Recursive generation | +| array | List generation with items | +| enum | random_element() | + +## License + +MIT License \ No newline at end of file