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.2.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.2-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proof_citations-1.33.2.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.2.tar.gz
Algorithm Hash digest
SHA256 080f275272ff326b982e7c989d1044e5f002aea812977907bc6d8448a447aa33
MD5 04e8a4e2f2b5d8ef1c507d27593dfa7f
BLAKE2b-256 9cdab85720d73619b18c0f6e7faf705c3c47c2aaf081715aee1479c554a9daa8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for proof_citations-1.33.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fabd1bdbf96f9f40a0f8e2ce8e470cb308d01a9679f4183d148af753cd939c7e
MD5 00baa96004d554fd5a5e12487f65634d
BLAKE2b-256 07bd83e509a9e9aee2a7a504512ebc8775b61c3d961e3e21de0135d0c3e47c45

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