Rowsmith test data

v0.5.0
io.github.meiorz/rowsmith Checked 8 hours ago Published 1 month ago

Fake test data (CSV, JSON, SQL) from a schema.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

generate_test_data Generate test data

Generate 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. For related tables with matching keys, pass tables (one call, SQL or JSON). Next: invalid_values for values your code should reject. 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; e…

ParameterTypeDescription
chaosobjectDeliberate misbehaviour for testing error handling
columnsarrayThe table's columns, 1 to 50
formatstringOutput format (default csv)
output_pathstringWrite 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
overwritebooleanReplace output_path if it already exists (default false)
rowsintegerNumber of rows, 1 to 500 (default 100)
schemaobjectInstead of columns: a JSON Schema object, or {openapi: <document>, component: <name>}
seedintegerSeed; the same schema and seed give identical output for the same generator version (default 1)
tablestringTable name, used in SQL output (default data)
tablesarrayInstead of columns, schema, rows, table: related tables in order, each {name, rows, columns or schema}. A column {name, type: 'ref', table, column} takes its values from an earlier table's primary key…

list_column_types List column types

List the supported column types and the options each accepts. Use it before generate_test_data when you need a type's options.

invalid_values Invalid test values

Deliberately invalid TEST DATA values (malformed emails, declining or Luhn-invalid card numbers, malformed addresses, Unicode edge cases, invalid IBAN and SSN shapes), each with the reason it is invalid. Same seed, same output for the same catalogue version. Use it after generate_test_data, to test that your validation rejects bad input.

ParameterTypeDescription
chaosobjectDeliberate misbehaviour for testing error handling
countintegerDefault 10
fieldsstringComma-separated fields to keep, e.g. value,reason
kindstringDefault all
seedinteger