Skip to main content

Terminal report screenshot

structured-output-doctor

structured-output-doctor is a local CLI and desktop checker for pasted model outputs that are supposed to match a JSON contract.

It helps catch:

  • invalid JSON hidden inside Markdown fences or surrounding prose
  • missing required fields
  • type drift such as "yes" where a boolean is expected
  • enum values outside an allowed set
  • mixed array item types
  • unexpected top-level fields

The tool has no runtime dependencies.

Install

pip install structured-output-doctor

For local development:

python3 -m pip install -e .

Quick Start

Check a model output against a lightweight schema:

structured-output-doctor examples/model-output.txt --schema examples/support-schema.json

Write a Markdown handoff report:

structured-output-doctor examples/model-output.txt \
  --schema examples/support-schema.json \
  --format markdown \
  --output-file structured-output-report.md

Read output from stdin:

cat response.txt | structured-output-doctor --schema schema.json --fail-under 80

Open the desktop paste-and-check app:

structured-output-doctor-gui

Schema Format

Use a compact fields array:

{
  "additional_fields": "warn",
  "fields": [
    { "path": "summary", "type": "string", "non_empty": true },
    { "path": "priority", "type": "string", "enum": ["low", "medium", "high"] },
    { "path": "actions", "type": "array", "items": "string" },
    { "path": "needs_human_review", "type": "boolean" }
  ]
}

Supported types are any, array, boolean, float, integer, null, number, object, and string. Nested paths use dotted names and array indexes, such as choices[0].message.content.

Basic JSON Schema-style objects with properties and required are also accepted for simple field checks.

Report Formats

structured-output-doctor response.txt -s schema.json --format text
structured-output-doctor response.txt -s schema.json --format markdown
structured-output-doctor response.txt -s schema.json --format json
structured-output-doctor response.txt -s schema.json --format html --output-file report.html

Exit codes:

  • 0: parsed and passed the configured score threshold
  • 1: validation failed or the score is below --fail-under
  • 2: command usage or file loading failed

Development

Run tests:

PYTHONPATH=src python3 -m unittest discover -s tests

Build and check package artifacts:

python3 -m build --no-isolation
python3 -m twine check dist/*

Contributing

Issues and pull requests are welcome. Keep changes focused, include tests for behavior changes, and update this README when command behavior changes.

Metadata

Release files for structured-output-doctor 0.1.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 structured-output-doctor 0.1.0
File Size Uploaded Provenance Actions
structured_output_doctor-0.1.0.tar.gz 12.2 kB Without provenance Details for structured_output_doctor-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for structured-output-doctor 0.1.0
File Interpreter ABI Platform Actions
structured_output_doctor-0.1.0-py3-none-any.whl Python 3 none any Details for structured_output_doctor-0.1.0-py3-none-any.whl

Total release size: 22.8 kB

Release files / structured_output_doctor-0.1.0.tar.gz

Download URL structured_output_doctor-0.1.0.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f1e75e3713eb50bbf870543dc8ae7d56d8b4281b23e040099a28689a62b7a18
BLAKE2b-256 checksum
How to use checksums
87f0aed26b0a7e03885e8d62b52ec66f86a4037f90013e2428a7c14be48f5e0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / structured_output_doctor-0.1.0-py3-none-any.whl

Download URL structured_output_doctor-0.1.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8efaa8812f9baf4d087b4ef2fb503b1fe56e523722e626bdd084b273272e298b
BLAKE2b-256 checksum
How to use checksums
5f9087bc0e908a495b4c931adea5c64cbc4bc291eef72c2dcae10bcdddb264fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for structured-output-doctor 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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