Minimal pagedigest consumer reference implementation
Project description
Python Consumer (Minimal Reference)
Install (from repo)
cd implementations/python-consumer
uv sync
uv pip install -e .
Requires Python ≥3.9. Runtime dependency: requests.
API
fetch— fetch and validate manifest; graceful fallback on errorsdiff— compare manifest to cachedsite_rev/ per-URLrevaudit— identity-encoding digest check (streams the body with a size cap)check_site—fetch+diff+ optional sampled audit planverify_live— fetch a manifest and sample live identity-encoded responses for digest verificationidentity_digest— stream-hash astream=Trueresponse body, capped atmax_bytes, for custom audit pipelinesvalidate_manifest,resolve_url_key,manifest_url— validation and URL helpersformat_state_header,parse_state_header— strict optionalPageDigest-Statehelpers
CLI
pagedigest verify-live https://example.com --sample-size 25
verify-live exits 2 on digest mismatches so it can act as a deployment gate.
Redirects, network errors, and body-size caps are reported as inconclusive.
Example
from pagedigest import check_site
decision = check_site(
"https://example.com",
cached_site_rev=12,
cached_revs={"/": 3, "/about": 1},
sample_audit_rate=0.01,
)
After a successful manifest check, an integration may make its observed state visible on subsequent page requests:
from pagedigest import format_state_header
headers = {
"PageDigest-State": format_state_header(
decision["manifest"]["site_rev"],
"/.well-known/pagedigest.json",
)
}
This is a corroborating observation signal, not authentication. See SPEC.md §5.4.
Conformance fixtures: tests/test_vectors.py exercises ../../test-vectors/.
Persistent cache example
uv run python examples/cache_persistence.py https://example.com ./pagedigest-cache.json
The example stores site_rev, per-URL rev, ETag, and Last-Modified
between runs. It prints page fetch decisions so crawler/indexer integrations can
replace the print calls with their own fetch pipeline.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pagedigest-0.1.0.tar.gz.
File metadata
- Download URL: pagedigest-0.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f68cac82aacba910dab4695f4c7b2b0a9b234d8d9cb430b680629c2f5d00a55
|
|
| MD5 |
04097484af17273c69d74c594fa9f1ba
|
|
| BLAKE2b-256 |
ca11dfb5eca656956a82abf5f77755349c6f6943c13589e0658ee1e20f1a9d55
|
Provenance
The following attestation bundles were made for pagedigest-0.1.0.tar.gz:
Publisher:
publish-python.yml on maxwellsantoro/pagedigest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pagedigest-0.1.0.tar.gz -
Subject digest:
9f68cac82aacba910dab4695f4c7b2b0a9b234d8d9cb430b680629c2f5d00a55 - Sigstore transparency entry: 2065004259
- Sigstore integration time:
-
Permalink:
maxwellsantoro/pagedigest@715513964327b49ccecd52c6cd4a24e3aebc0380 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/maxwellsantoro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@715513964327b49ccecd52c6cd4a24e3aebc0380 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pagedigest-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pagedigest-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56eced6ac1215d07db2074fd3a7773b6974ef062d5e4ad3e15d7b562472d97d5
|
|
| MD5 |
f2bd6adef9cc65580f667e573d3e3e62
|
|
| BLAKE2b-256 |
1340eb7c6513bec2eb9eada5b33418f5e047fe8862b97a6d4ebd3694ddcf84a7
|
Provenance
The following attestation bundles were made for pagedigest-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on maxwellsantoro/pagedigest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pagedigest-0.1.0-py3-none-any.whl -
Subject digest:
56eced6ac1215d07db2074fd3a7773b6974ef062d5e4ad3e15d7b562472d97d5 - Sigstore transparency entry: 2065004308
- Sigstore integration time:
-
Permalink:
maxwellsantoro/pagedigest@715513964327b49ccecd52c6cd4a24e3aebc0380 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/maxwellsantoro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@715513964327b49ccecd52c6cd4a24e3aebc0380 -
Trigger Event:
push
-
Statement type: