Usage

This section outlines the basic features of fodder and how to use them.

CLI

fodder --help
A data generation tool

Usage: fodder [OPTIONS] --schema <SCHEMA>

Options:
  -s, --schema <SCHEMA>  Path to the schema file
  -n, --nrows <NROWS>    Number of rows to generate [default: 3]
  -f, --format <FORMAT>  Output format [default: json] [possible values: csv, json, ndjson]
  -d, --definition       Show the JSON schema definition for allowed inputs, useful for autocompletion
  -h, --help             Print help
  -V, --version          Print version

Quickstart

Create a schema file

Here's an example schema file displaying some of the features THERE ARE MANY MORE.

cat > schema.fodder.yaml <<EOF
fields:
  # Generate a number between 0 and 10
  - name: A
    type: IntegerInRange
    args:
      min: 0
      max: 10
  # Generate a number between 0 and 20
  - name: B
    type: IntegerInRange
    args:
      max: 20
    # That is greater than A
    constraints:
      - type: GreaterThan
        name: A
  # Generate a datetime
  - name: C
    type: DateTime
    # With a 90% probability of being null
    null_probability: 0.9
  # Generate a sentence if C is null
  - name: D
    type: String
    args:
      subtype: Sentences
    constraints:
      - type: IfNull
        name: C
EOF

Generate some data

fodder --schema schema.yaml --format csv --nrows 3
ABCD
918aut nostrum quod vero ratione in numquam qui temporibus.
7142592-10-28T02:43:00+00:00
414accusantium omnis aperiam velit est ea in et.