Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sendproof-core

Framework-neutral core of the Sendproof Python adapters. Install a framework package such as sendproof-fastapi rather than using this directly. Use it to:

  • record effects from application code, and
  • write an adapter for another framework or a data layer for another database library.

Recording effects

Call these at the point where your application delivers an email, publishes a message or calls another service. Each returns True when the request is a rollback preview and you must skip the delivery. During an Observed Send they record the intent as delivered: true and return False, so you still deliver.

from sendproof_core import record_email

if not record_email("Welcome", sender, [to], [], "Welcome", "Hello!"):
    mailer.send(...)

record_http, record_job, record_message and record_effect follow the conventional data shapes in the protocol. Ordinary logging records from loggers that propagate to the root logger are captured too (set the logger level to INFO or lower to see them).

Data stores

sendproof_core.stores holds the write guard and the MongoDB, Redis, DynamoDB, Cassandra, Elasticsearch, OpenSearch, Cosmos DB and Firestore hooks that the framework packages accept as data_stores. Each hook imports its client library on first use, so the core still needs none of them. See Data stores in the Python binding.

Capture limits

Logs 500, effects 100, changes 200, log properties 32, SQL parameters 64. Anything beyond a limit is dropped and flagged with logsTruncated, effectsTruncated or changesTruncated. Unserializable effect data is replaced by null and flagged. SQL parameters named like secrets show [REDACTED], and parameter values are hidden outside Development unless you opt in.

Redaction

A name is secret when one of its words is password, passwd, pwd, secret, token, hash, salt, credential(s) or apikey, when key follows api, private, secret, access, signing, encryption or client, or when key, data, id or token follows session. Secret-named SQL parameters, every value of a statement that names a secret (for example any statement on Django's django_session table), and secret-named columns in change snapshots (key, before, after) always show [REDACTED]. Records from the sqlalchemy.engine and django.db.backends loggers are not captured, because they print bound values; the providers record each statement themselves with redaction applied.

Commit guard

While a preview runs, providers refuse SQL that would end its transaction (COMMIT, END, ROLLBACK without TO, SET autocommit, the provider's own savepoint, and DDL that MySQL, MariaDB and Oracle commit implicitly) and refuse switching the connection to autocommit. The statement raises PreviewRollbackError before it reaches the database and the preview answers an unconfirmed 500 (sendproof_core.txguard).

Writing a data-layer provider

Subclass PreviewProvider. begin(scope) must be cheap and synchronous, store its state in scope.extensions, and return a PreviewSession whose rollback() raises PreviewRollbackError when it cannot confirm the rollback and whose close() releases everything, partially acquired resources included. Raise PreviewUnavailable from begin when the operation cannot be enrolled, for example when a connection autocommits. Never fabricate before/after rows: report only what you observed.

Writing a framework adapter

Use Workbench for discovery, assets, traces and envelopes, protocol for the request rules, Capture/RequestScope for per-request state, and TraceStore for traces. The FastAPI adapter is a complete example.

Metadata

Release files for sendproof-core 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sendproof-core 0.1.0a2
File Size Uploaded Provenance Actions
sendproof_core-0.1.0a2.tar.gz 1.4 MB With provenance Details for sendproof_core-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sendproof-core 0.1.0a2
File Interpreter ABI Platform Actions
sendproof_core-0.1.0a2-py3-none-any.whl Python 3 none any Details for sendproof_core-0.1.0a2-py3-none-any.whl

Total release size: 2.9 MB

Release files / sendproof_core-0.1.0a2.tar.gz

Download URL sendproof_core-0.1.0a2.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
19a4bf8f1a36993458b83255bdc8a6121f88320a1f19d818ec2dc2a4e78967fc
BLAKE2b-256 checksum
How to use checksums
cac6e1a93da07de1d9bbbcc04d02018362b3ab18994b026de9462dbe6f769ddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / sendproof_core-0.1.0a2-py3-none-any.whl

Download URL sendproof_core-0.1.0a2-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a56d01a20e6e7611711721eeb9edb0cc15283d4e5728564188b7d01802c53854
BLAKE2b-256 checksum
How to use checksums
4371174af09691f61c021a0aeb1cb914fe207133c5dc5fd899bc95bcb183f862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for sendproof-core 0.1.0a2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sendproof_core-0.1.0a2.tar.gz

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 Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page