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.0a1

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.0a1
File Size Uploaded Provenance Actions
sendproof_core-0.1.0a1.tar.gz 1.0 MB With provenance Details for sendproof_core-0.1.0a1.tar.gz

Built distribution (wheel)

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

Total release size: 2.2 MB

Release files / sendproof_core-0.1.0a1.tar.gz

Download URL sendproof_core-0.1.0a1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
958c653828574abcde1d94501d4e76c5a9325c3cb89a1ea67fb6d3dfd977716a
BLAKE2b-256 checksum
How to use checksums
d561679748ec0f66cb2eda38a6a92703a185b913febf2596d614cdd144f1d1a9
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 22, 2026.

Transparency log

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

Download URL sendproof_core-0.1.0a1-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9e17b3e08f63fdbfc884339aeff449a6d8794755110d81d788c9ca73c444418d
BLAKE2b-256 checksum
How to use checksums
8252697c1870d0f00a2b12548f93d535a4ab8a712c3e6cb7090297cb88dd3081
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 22, 2026.

Transparency log

Security for sendproof-core 0.1.0a1

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.0a1.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 22, 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