Generate random data to test your application.
- Python 3.12 or 3.13
- uv
git clone https://github.com/eiri/echolalia.git
cd echolalia
uv syncuv sync creates the virtual environment and installs all dependencies.
$ uv run echolalia -c 2 -t templates/people.json
[{"name": {"lastName": "Shannon", "firstName": "Rhonda"}, "tags": ["nihil", "fngheqnl", "impedit", "consequatur"], "age": 30, "state": "Hawaii, AR", "sex": "F", "phone": "03744269231", "single": true, "street": "4081 Sharon Ranch Apt. 197", "postcode": "ZIP: 02709-0053", "times": {"createdAt": "2017-02-13 13:14:08", "updatedAt": "2017-09-23 15:37:29"}, "email": "tiffany87@hotmail.com"}, {"name": {"lastName": "Hanson", "firstName": "Robert"}, "tags": ["quasi", "##tuesday###", "deserunt", "laborum"], "age": 104, "state": "Nevada, FL", "sex": "F", "phone": "(698)292-8761x6944", "single": false, "street": "3898 Alexandria Parkways", "postcode": "ZIP: 24439", "times": {"createdAt": "2017-05-03 03:16:21", "updatedAt": "2017-09-23 15:37:02"}, "email": "zfowler@hotmail.com"}]$ uv run echolalia -c 2 -i name -i email=free_email -f csv
Bruce Day,lori09@yahoo.com
Janice Turner,matthew72@sanders.comTo skip the uv run prefix, activate the virtualenv first:
source .venv/bin/activate
echolalia -c 2 -i name -i email=free_email -f csvuv sync --dev
uv run pytestTemplates are JSON objects. Keys become keys in the generated document; values are faker method names.
To pass arguments to a method, use an object with "attr" and "args":
{ "birthday": { "attr": "date_of_birth", "args": [null, 18, 65] } }A key's value can also be a list of methods, which produces an array. For composite strings, use mustache syntax: "{state}, {state_abbr}". To transform the result after generation, add a "postprocess" key with a str method name.
See templates/people.json for a full example.
raw — returns the data as a Python object, no serialization.
json — JSON output.
csv — CSV output. Pass --with_header to add a header row. Nested objects are flattened to strings.
yaml — YAML output, always in block style.
stdout — prints to standard output (default).
file — writes to a file; requires -o/--output.