Skip to main content

Fetch URLs and verify that quoted text appears on the page. Extracted from proof-engine.

Project description

proof-citations

Fetch URLs and verify that quoted text appears on the page — the citation-verification primitive extracted from Proof Engine.

Install

pip install proof-citations

Library

from proof_citations import verify_citation

result = verify_citation(
    "https://example.com/article",
    "the exact quoted sentence",
    "B1",                 # fact_id — used in messages
)
print(result["status"])   # "verified" | "partial" | "not_found" | "fetch_failed"
print(result["credibility"]["tier"])

CLI

proof-citations verify --url URL --quote "QUOTE TEXT" --fact-id B1
proof-citations verify --facts facts.json

Why

LLMs hallucinate citations. This package does one job: fetch the URL, normalize unicode and HTML, and confirm the quoted text is actually on the page. It handles PDFs, Wayback fallback, and the unicode quirks (en-dash vs hyphen, curly quotes, non-breaking spaces, HTML-entity-encoded quotes) that real citations contain.

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

proof_citations-1.33.1.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

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

proof_citations-1.33.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file proof_citations-1.33.1.tar.gz.

File metadata

  • Download URL: proof_citations-1.33.1.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for proof_citations-1.33.1.tar.gz
Algorithm Hash digest
SHA256 263d72fb9227138c36cae418e22f3ebd0a49e7647b3cfe1eed218c49ba4def2f
MD5 ebca142e6cee808eb20613531b908c5f
BLAKE2b-256 eaedf416a0cc123ff91183b7f168c395ec39c3f5cf3abb31b3284f3545586420

See more details on using hashes here.

File details

Details for the file proof_citations-1.33.1-py3-none-any.whl.

File metadata

File hashes

Hashes for proof_citations-1.33.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae7e1a83cfd470387db8a215f604e46a4557c3894f31e23aaaf3d7febc629727
MD5 ceba0c9da8eca6cc2e90c0f855a0a78e
BLAKE2b-256 5f867194ed261a9c6d23f80b62c4bf2343d259a76a12248e1535b813827ccd8d

See more details on using hashes here.

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