Skip to main content

Precis CLI

Local-first data validation engine — define schemas and constraints in YAML, validate CSV / TSV / Excel / JSON / JSONL with a single command.

Beta — core functionality is stable and the configuration format is versioned and frozen (V2, additive changes only).

Installation

pip install precis-cli          # requires Python >= 3.12

# Or run without installing (requires uv)
uvx --from precis-cli precis --version

The distribution name is precis-cli; the command name is precis (precis-cli works as an equivalent alias).

Quick Start

# 1. Infer a draft schema from a data file
precis infer-schema orders.csv > schemas/orders.schema.yaml

# 2. Register the schema and constraint files in the project manifest
#    project.precis.yaml (format shown below)

# 3. Run validation
precis validate --manifest project.precis.yaml --format json

Exit code contract (CI / AI-agent friendly):

Exit code Meaning
0 Validation passed
1 Validation completed and found data violations (see errors in the JSON output)
2 Tool error (invalid arguments, missing file, unhandled crash)

Configuration Example (V2 YAML)

project.precis.yaml:

version: 2
project:
  id: my-project
  name: Orders validation
schemas:
  - id: orders
    path: schemas/orders.schema.yaml
constraints:
  - id: orders_amount_range
    path: constraints/orders_amount_range.constraint.yaml

constraints/orders_amount_range.constraint.yaml:

version: 2
id: orders_amount_range
type: Range
enabled: true
refs:
  table_id: orders
  column_id: amount
params:
  min: 0
  max: 1000000
  boundary_mode: inclusive

10 Constraint Types

NotNull not null · Unique unique · AllowedValues allowed values · Range numeric range · ForeignKey cross-table reference · Conditional conditional constraint · Scripted scripted expression · Charset character set · DateLogic date logic · Composite composite constraint

Data types: string / integer / float / decimal / boolean / date. Large files (>500MB) are loaded in chunks automatically.

AI Agent Integration

The --format json output is a machine-readable contract (including row-level error locations and traceability back to the constraint source file), ready to be consumed by AI coding assistants:

  • MCP server: after pip install "precis-cli[mcp]", run precis-mcp (stdio), which exposes four tools: validate_data / infer_schema / check_config / describe_constraints
  • Kimi Code plugin: /plugins install https://github.com/AirSaiga/Precis
  • Built-in CLI AI commands (generate or modify validation config in natural language, independent of the host agent): pip install "precis-cli[ai]", then precis ai chat or precis ai ask "..."

License: Apache-2.0

中文简介

本地优先的数据校验引擎:用 YAML 定义表结构与约束规则,一条命令校验 CSV / TSV / Excel / JSON / JSONL。 安装:pip install precis-cli(需 Python >= 3.12),或免安装运行 uvx --from precis-cli precis --version。 最简上手:precis infer-schema orders.csv > schemas/orders.schema.yaml,在 project.precis.yaml 中登记 schema 与约束文件后, 执行 precis validate --manifest project.precis.yaml --format json。 退出码:0 校验通过 · 1 发现数据违规 · 2 工具自身错误。命令名为 precis(precis-cli 为等价别名)。

Metadata

Release files for precis-cli 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for precis-cli 0.1.12
File Size Uploaded Provenance Actions
precis_cli-0.1.12.tar.gz 929.2 kB With provenance Details for precis_cli-0.1.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for precis-cli 0.1.12
File Interpreter ABI Platform Actions
precis_cli-0.1.12-py3-none-any.whl Python 3 none any Details for precis_cli-0.1.12-py3-none-any.whl

Total release size: 2.3 MB

Release files / precis_cli-0.1.12.tar.gz

Download URL precis_cli-0.1.12.tar.gz
Size 929.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b8b9fb30dbc9ce91300ceb1c7585aa9fcb427e1dfb5f3cf4eec38449a9a3ca23
BLAKE2b-256 checksum
How to use checksums
bf1d179c324a5cbba44e6c5057ea16b6c5b9e1a4ead066f41a083b8f7a2181ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / precis_cli-0.1.12-py3-none-any.whl

Download URL precis_cli-0.1.12-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c50f756b1a8e8231d01c69de17deab1764f76c7428484955f6bccc09191bba6e
BLAKE2b-256 checksum
How to use checksums
42ebb1c082ded25aec6b689e934dfda6e4d54969ae3a3eb0ac9e36b90fde2d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for precis-cli 0.1.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for precis_cli-0.1.12.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page