SeenRelay Python client
Measure and avoid redundant expensive validation.
Deterministic, standard-library-only client that places SeenRelay CHECK around repeated source-backed validation while preserving the application's original validation by default.
Client 0.2.4 is published and clean-install verified on PyPI. Source release metadata is staged at 0.2.5 for synchronized publishing, but Python behavior remains conservative and shadow-first. The 0.2.5 direct Firecrawl SDK shadow adapter is JavaScript / TypeScript-only; Python parity is not claimed.
Install
pip install seenrelay
Smallest integration: bind once, one line per revalidation
from seenrelay import SeenRelayClient
from seenrelay_easy import protect_validation
relay = SeenRelayClient()
validate_price = protect_validation(
relay,
fact=fact,
validate=lambda ctx: expensive_validation(ctx.conditional_headers),
)
value = validate_price(known_value)
That is strict shadow mode by default: SeenRelay CHECK runs, your original validation still runs, and the independently obtained result is OBSERVEd best-effort. Nothing is skipped merely because SeenRelay is installed.
Only after measurement and policy approval should you add an explicit reuse policy:
from seenrelay import reuse_known_on_same_observed
validate_price = protect_validation(
relay,
fact=fact,
validate=lambda ctx: expensive_validation(ctx.conditional_headers),
reuse=reuse_known_on_same_observed,
)
Direct client form
value = relay.guard(
fact=fact,
known_value=known_value,
validate=lambda ctx: expensive_validation(ctx.conditional_headers),
)
Without an explicit reuse policy, validation is never skipped.
Prove value before enabling reuse
from seenrelay import SeenRelayClient
from seenrelay_shadow import SeenRelayShadowProof
proof = SeenRelayShadowProof(SeenRelayClient())
value = proof.guard(
fact=fact,
known_value=known_value,
validate=lambda ctx: expensive_validation(ctx.conditional_headers),
)
print(proof.report(
avoided_validation_cost=0.01,
))
Python Shadow Proof keeps the original validation. It measures CHECK status distribution, validation time and SeenRelay request latency locally. Potential savings count only SAME_OBSERVED calls and subtract caller-supplied request costs. Savings from conditional ETag / Last-Modified requests are deliberately excluded unless measured separately by the application.
Use SeenRelay around repeated validation that is materially more expensive than the preflight: paid search, scraping/proxy work, browser or extraction calls, rate-limited APIs, model-assisted parsing, or multi-step validation. It is generally a poor fit for a cheap one-off GET.
Protocol boundary
The Python client does not add a SeenRelay operation. The hosted service still exposes only CHECK and OBSERVE and does not browse, search or verify arbitrary facts on demand.
License
The client package is MIT licensed. The hosted SeenRelay service implementation remains governed by the repository root license.
Metadata
Release files for seenrelay 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| seenrelay-0.2.5.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| seenrelay-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / seenrelay-0.2.5.tar.gz
| Download URL | seenrelay-0.2.5.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
689a822b591601eed4dea28b21c5c7eb6803bf76dcb452158a8282169207af5a
|
|
BLAKE2b-256 checksum How to use checksums |
4c6ef6fc1159951a37936b1c688f9f25c8d5f5a8ac40edda547f9f3618863fd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / seenrelay-0.2.5-py3-none-any.whl
| Download URL | seenrelay-0.2.5-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be001e5f2cbdb55b4ce4660e702fa38ead1746d3b37bcb44f0a69cd4c03312ef
|
|
BLAKE2b-256 checksum How to use checksums |
6c5621aa60842a0e37aa0123b1f3f6635b4733b4bb3e817df02f47d3663e585f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency log