Skip to main content

Reference Python SDK for the Docs Feedback Protocol

Project description

fixyourdocs (Python SDK)

Reference Python SDK for the Docs Feedback Protocol v0. The protocol lets AI agents file structured reports against documentation pages when the docs break agent task flows.

Install

pip install fixyourdocs

Requires Python 3.9+.

CLI

The package ships a fixyourdocs console script covering the two one-liners from the agents-md-snippet README:

# Adds the canonical AGENTS.md block to your repo. Idempotent.
pipx run fixyourdocs init

# Sends a single report to the Hub.
pipx run fixyourdocs report \
  --doc-url https://example.com/docs/install \
  --summary "Install fails on macOS 14" \
  --agent claude-code \
  --kind broken

init auto-detects AGENTS.md, CLAUDE.md, .cursor/rules, or .github/copilot-instructions.md and appends to whichever exists (falling back to creating AGENTS.md). Pass --file <path> to override.

report accepts --details, --suggested-fix, --api-url, --token, and --json for machine-readable output. Exit codes: 0 success, 2 user error, 1 transport or server error.

Usage (sync)

from fixyourdocs import Client, Report

report = Report.create(
    doc_url="https://docs.example.com/getting-started",
    summary="The page does not document how to set the API_KEY env var.",
    kind="missing",
    agent_name="claude-code",
)

with Client(api_url="https://hub.fixyourdocs.io") as client:
    result = client.send(report)

print(result.id, result.is_duplicate)

Usage (async)

import asyncio
from fixyourdocs import AsyncClient, Report

async def main() -> None:
    report = Report.create(
        doc_url="https://docs.example.com/getting-started",
        summary="The page does not document how to set the API_KEY env var.",
        kind="missing",
        agent_name="claude-code",
    )
    async with AsyncClient(api_url="https://hub.fixyourdocs.io") as client:
        result = await client.send(report)
    print(result.id, result.is_duplicate)

asyncio.run(main())

API shape

The wire format is a nested object (agent, report, task_context), so the SDK exposes two ways to build a Report:

  • Report.create(...) — ergonomic, flat keyword-argument constructor for the common case. Internally builds the nested wire-format structure.
  • Report(agent=AgentInfo(...), report=ReportBody(...), ...) — the typed nested form, useful when constructing reports programmatically from already-typed sub-objects.

Both produce identical wire output.

Errors

Non-2xx responses raise typed exceptions:

Status Exception
400 ValidationError (.details)
401 AuthError
404 NotFoundError
410 OptedOutError (.since)
413 PayloadTooLargeError (.max_bytes)
415 UnsupportedMediaTypeError
422 PolicyRejectedError (.reason)
429 RateLimitedError (.retry_after)
5xx ServerError (after one automatic retry on 502/503/504)

All inherit from FixYourDocsError.

Licence

Apache License 2.0 — see LICENSE.

Contributing

Contributions require a DCO sign-off and a signed Apache Individual Contributor License Agreement — see CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fixyourdocs-0.2.1.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fixyourdocs-0.2.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file fixyourdocs-0.2.1.tar.gz.

File metadata

  • Download URL: fixyourdocs-0.2.1.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fixyourdocs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 56f0a3a791d49c19fbca3473af0fcfca57afa24e98cb4bfe7ffff609f9039c88
MD5 0ec1de5c4260fa7a7286694302289cd8
BLAKE2b-256 36befec24d236efd12e442f2ef36327c4e8ea1a964e5c5d58b1d3bbfde771686

See more details on using hashes here.

Provenance

The following attestation bundles were made for fixyourdocs-0.2.1.tar.gz:

Publisher: publish.yml on fixyourdocs/sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fixyourdocs-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fixyourdocs-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fixyourdocs-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4676d4ade6694139fe37fbafb6f26c118f8add876cf49e7f84d4eff9b95be3a5
MD5 a1b5241abfe5be3d09b42a2a434c3386
BLAKE2b-256 69a0bc0173aa56e67f48a58d70a19266333f75ffb46d0467a35ae318100d345e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fixyourdocs-0.2.1-py3-none-any.whl:

Publisher: publish.yml on fixyourdocs/sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page