Generate test data
generate_test_dataGenerate realistic fake CSV, JSON, or SQL INSERT test data from a table schema for fixtures, seed rows, and tests, with reproducible output via seeds.
Instructions
Generate realistic fake test data (CSV, JSON or SQL INSERTs) from a table schema. Use it first, when you need rows for fixtures, seed data or tests (list_column_types gives each type's options). Or pass schema (JSON Schema, e.g. a Pydantic or Zod export, or an OpenAPI component) instead of columns; unmappable fields are named. Next: invalid_values for values your code should reject, then sandbox_create and sandbox_payments to test a payment flow. Free and rate-limited: up to 500 rows and 50 columns per call. No real person's data is used as input and no record is derived from a real person; emails, phones, card numbers, SSN-shaped and IBAN-shaped values come only from reserved or invalid ranges. The same schema and seed give byte-identical output for the same generator version (sent as x-generator-version). For more than about 50 rows, pass output_path to write a file instead of returning the data. The result gives the output's sha256 and ends with a curl that regenerates the same bytes. Send schemas only, never real data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Number of rows, 1 to 500 (default 100) | |
| seed | No | Seed; the same schema and seed give identical output for the same generator version (default 1) | |
| chaos | No | Deliberate misbehaviour for testing error handling | |
| table | No | Table name, used in SQL output (default data) | |
| format | No | Output format (default csv) | |
| schema | No | Instead of columns: a JSON Schema object, or {openapi: <document>, component: <name>} | |
| columns | No | The table's columns, 1 to 50 | |
| overwrite | No | Replace output_path if it already exists (default false) | |
| output_path | No | Write the data to this file instead of returning it (use for more than about 50 rows). Must be inside the working directory, or inside ROWSMITH_OUT_DIR when set; no '..' segments |