Technical previewShare feedback
Fairspec
FairspecMaking data FAIR

Open source · MIT License

Fairspec CLI

Bring the Fairspec data management framework to your shell. Validate datasets, infer schemas, and query tables — from scripts, CI pipelines, or an interactive terminal.

$ fairspec table infer-schema members.csv --json | jq -c .properties

{"id":{"type":"integer"},"name":{"type":"string"},"joined":{"type":"string","format":"date"},"score":{"type":"number"}}

$ fairspec table validate members.csv --schema schema.json

✔ Validation passed

Input

members.csv
id,name,joined,score
1,Ada,2024-01-15,91.5
2,Grace,2024-02-03,88.0
3,Linus,2024-03-21,79.25

One command, three runtimes

Every implementation ships the same fairspec command. Pick the ecosystem you already use.

  • The same fairspec command

    Python, TypeScript and Rust install one command with the same subcommands and options.

  • Library or command line only

    fairspec brings the library too; fairspec-terminal and @fairspec/terminal ship just the CLI.

  • Run without installing

    uvx fairspec or npx fairspec@latest runs the latest version on demand.

  • MCP server included

    fairspec mcp starts the MCP server from the same install.

Install

Install the fairspec command into an isolated environment with uv.

uv tool install fairspec

Need only the command line, without the library? Install fairspec-terminal instead.

Same command, both runtimes

The Python and TypeScript CLIs take the same arguments and print the same report.

Python
$ fairspec table validate broken.csv --schema schema.json

✖ Value of the cell x in column id of row 3 is not integer
✖ Value of the cell 2024-02-30 in column joined of row 2 is not date
TypeScript
$ fairspec table validate broken.csv --schema schema.json

✖ Value of the cell x in column id of row 3 is not integer
✖ Value of the cell 2024-02-30 in column joined of row 2 is not date

Built for scripts and CI

Every command takes local paths or URLs and prints JSON with --json.

examples
  • $ fairspec dataset infer *.csv --json > dataset.json
  • $ fairspec dataset validate dataset.json
  • $ fairspec table describe data.csv
  • $ fairspec table preview data.csv
  • $ fairspec table query data.csv "SELECT * FROM self WHERE age > 25"
  • $ fairspec table validate data.csv --json
  • $ fairspec table validate data.csv --check "positive-price=price > 0"
  • $ fairspec file describe data.csv --hash-type sha256
  • $ fairspec mcp
  • Local paths or URLs

    Point any table, file or dataset command at a file on disk or a remote URL.

  • JSON for pipelines

    Add --json and the result is data your script or CI job can read, not prose.

  • Custom checks

    Add rules the schema cannot express with --check name=condition: a SQL condition every row must meet, or an aggregate over the whole table.

  • Dialects on the command line

    Override what inference guesses with --delimiter, --header-rows or --sheet-name.

  • Interactive sessions

    fairspec table script and fairspec dataset script open a scripting session on the loaded data.

Script your data. Check it in CI.

Read the full command reference, or hand the same commands to your AI assistant.