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.

Alpha — core functionality is stable and the configuration format is versioned (V2).

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.11

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.11
File Size Uploaded
precis_cli-0.1.11.tar.gz 921.0 kB Details

Built distribution (wheel)

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

Total release size: 2.3 MB

Release files / precis_cli-0.1.11.tar.gz

Download URL precis_cli-0.1.11.tar.gz
Size 921.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e5bcfb27785ac5530143e029d73ed3b28bc0a26394bba784dea7b894abc29fde
BLAKE2b-256 checksum
How to use checksums
2b07520023fe1ea1b8c0d39865d872e2a94f07178ea9f98c48a44bf8b7363e8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

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

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

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 Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

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