Skip to main content

comparo

HTTP regression & diff testing across environments — TUI, headless CLI, and CI.

comparo replays the same HTTP requests against two environments (say staging and prod), then diffs the responses to catch regressions before they ship. It understands that responses are not always byte-identical — so alongside a git-style content diff it does a structural diff you configure: ignore volatile fields, tolerate array-length differences, validate against a schema, or require exact equality, per JSON path.

It is not tied to any particular API — the bundled example targets httpbin, but the engine knows nothing about your domain. What to compare, ignore, or tolerate is all declarative config.

One engine (comparo.core) powers three front-ends that never leak back into it:

  • a TUI to explore a project, run requests with live results, diff environments, and triage;
  • a headless CLI for the same, scriptable;
  • a GitHub Action that fails the build on untriaged drift.

Status

Pre-1.0, under active development — a first beta. A runnable, self-contained example lives in examples/sample-project.

Install

pipx install comparo

Quickstart

Scaffold a project (a comparo.yaml manifest plus a .comparo/ starter), then explore it — from a directory with a comparo.yaml, commands need no path and a bare comparo opens the TUI:

# create a new project and open the terminal UI
comparo init
comparo

# validate and run — the ./comparo.yaml is picked up automatically
comparo validate
comparo run --env local

comparo init scaffolds a single local environment; add a second environment and a diffPairs entry to the manifest, then diff them:

comparo diff --baseline local --candidate staging --report junit --report markdown

Or work on a project elsewhere by pointing --config at its manifest — for example the runnable, self-contained examples/sample-project:

comparo validate --config examples/sample-project/comparo.yaml
comparo tui      --config examples/sample-project/comparo.yaml
comparo diff     --config examples/sample-project/comparo.yaml --pair local-vs-prod

The Terminal UI guide walks through each screen; the CLI reference documents every command and the GitHub Action.

Highlights

  • Structural diff, not just bytes. A DiffProfile decides, per JSON path, whether a field must be exact, match a shape, keep its type, stay within a tolerance, or be ignored.
  • Assert and diff, in one run. An ExecutionProfile evaluates assertions on both environments and diffs the pair, behind a single gate — the Execution tab replays it live.
  • Grouped drift. A field that drifts across three matrix cells reads as one bug, not three.
  • Reviewable triage. Silencing a drift writes an ignore rule into a committed profile — it shows up in git diff, not just in memory.
  • Secrets never leak. Values are masked in the TUI, redacted from saved runs and reports (even when a server echoes them back), and kept out of version control.
  • The gate is the gate. The TUI's Report screen, the CLI, and the Action share one reporter engine, so exit codes and verdicts match everywhere.

Concepts

Projects are described by version-controlled YAML objects, each with a Kubernetes-style envelope (apiVersion / kind / metadata / spec):

kind Purpose
Environment a target: base URL, timeout, credentials, variables, auth, health checks
Request an HTTP request (matrix-expanded, streaming, auth, cookies, body encodings) with a response schema and diff/assertion profiles
Schema a JSON Schema used for structural validation
Instance a reusable value injected by reference to avoid duplication
Matrix a set of parameter cases a request is run against (values can inject into the path)
DiffProfile how two responses are compared, per JSON path
AssertionProfile composable assertions run against a single response (status, body, latency, schema, …)
ExecutionProfile one declarative run that asserts both environments and diffs the pair, with a gate
Project run-wide defaults: environments, concurrency, retry, selection, reporting

The full format — every field, the ${...} interpolation grammar, the $ref/$val/$secret sigils, matrices, and diff modes — is in the configuration reference.

Documentation

Architecture

A single engine (comparo.core) powers the three front-ends — none of which the core depends on. The core imports no HTTP library; that lives behind an adapter. Both boundaries are enforced in CI by import-linter. See Architecture.

Contributing

See CONTRIBUTING.md. The gates — ruff, mypy --strict, import-linter, pytest — run on every commit via pre-commit.

License

MIT © Walid Benbihi

Metadata

Release files for comparo 0.2.0

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

Source distribution (sdist)

Source distribution for comparo 0.2.0
File Size Uploaded Provenance Actions
comparo-0.2.0.tar.gz 551.2 kB With provenance Details for comparo-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for comparo 0.2.0
File Interpreter ABI Platform Actions
comparo-0.2.0-py3-none-any.whl Python 3 none any Details for comparo-0.2.0-py3-none-any.whl

Total release size: 806.7 kB

Release files / comparo-0.2.0.tar.gz

Download URL comparo-0.2.0.tar.gz
Size 551.2 kB
Tags Source
SHA-256 checksum
How to use checksums
18112522f0ff47a08e8b9af2dd3d8ab32b84142f48ce1470b5ecd9f58714f509
BLAKE2b-256 checksum
How to use checksums
81856f3e4f9fab2db672318fb9d5f6403216dcc0ed50c4789018ef9e091a68f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 22, 2026.

Transparency log

Release files / comparo-0.2.0-py3-none-any.whl

Download URL comparo-0.2.0-py3-none-any.whl
Size 255.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aeba21708acbfe9c50166b49239c6265e19d312b5a3e73b0a254414503af630d
BLAKE2b-256 checksum
How to use checksums
1a8b4ffabeee37be62534cdd9c9d2d6b951793729ebf17055a569fd99e427b8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 22, 2026.

Transparency log

Security for comparo 0.2.0

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 comparo-0.2.0.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 Jul 22, 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