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.0.tar.gz (34.4 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.0-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proof_citations-1.33.0.tar.gz
  • Upload date:
  • Size: 34.4 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.0.tar.gz
Algorithm Hash digest
SHA256 3f4396dac5e88a03231e951ada92fbcb07c42e20c3172a18bbd802bde2a8239a
MD5 3620ff44f9d643edb2eeec23402e4aaa
BLAKE2b-256 c338dd65b20cc06747001123a9cd4b359cec6a4bdb9ec343100047e8cac58344

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for proof_citations-1.33.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc91d0a9771435fceca25c26428d99f7020b05f52af11e37e7617c1262fa1da7
MD5 c338a0725563c8406f499daa795d6245
BLAKE2b-256 b0c001601882cf921a4e7ec4c87939c3d64432379197ddee3f43e4898c925794

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