Skip to main content

MailSchema for Python

PyPI CI

Validate Mail Action Protocol documents and MailSchema Registry contributions with Draft 2020-12 JSON Schema checks.

Specification · Registry · Tools · Source

Install

pip install mailschema

Python 3.10 or newer is required.

Validate MAP documents

from mailschema import get_content_review_contract, validate_map_document, validate_content_review_request

validate_map_document(description)
validate_content_review_request(request)
contract = get_content_review_contract()

The CLI performs the same checks against local JSON files:

python -m mailschema check description.json --map
python -m mailschema check request.json --content-review

Work with Registry data

from mailschema import contribution_errors, get_contribution_schema, validate_contribution

errors = contribution_errors(candidate)
validate_contribution(candidate)  # Raises ValueError for invalid input.
schema = get_contribution_schema()

validate_record, record_errors and get_record_schema handle expanded Registry records. Pass --record to the CLI for the corresponding record format.

The package bundles the MAP 0.1 and Registry schemas plus the Content Review 0.1 and 0.2 request schemas and canonical type contracts. Unversioned Content Review helpers use 0.2; *_content_review_01_* helpers remain available for implementations pinned to 0.1. It uses the established jsonschema and referencing libraries for validation and performs no network requests.

Trust boundary

A valid document is structured input. Validation does not authenticate a service, grant authority, approve an action, resolve Registry history or establish product conformance. Implementations must apply their own endpoint trust, credentials, permissions and policy before executing a request.

The CLI reads one local file of at most 256 KiB and does not upload or modify it. Package versions and MAP profile versions advance independently. MIT licensed.

Metadata

Release files for mailschema 0.1.3

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

Source distribution (sdist)

Source distribution for mailschema 0.1.3
File Size Uploaded Provenance Actions
mailschema-0.1.3.tar.gz 13.3 kB Without provenance Details for mailschema-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mailschema 0.1.3
File Interpreter ABI Platform Actions
mailschema-0.1.3-py3-none-any.whl Python 3 none any Details for mailschema-0.1.3-py3-none-any.whl

Total release size: 25.6 kB

Release files / mailschema-0.1.3.tar.gz

Download URL mailschema-0.1.3.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0a3a7d8f67fbb583565b35d50b8f35842c1c6cdf968a337ada4aa476451c2c7e
BLAKE2b-256 checksum
How to use checksums
c7dd2280e6bd656d5b2389af27b7bb562a064a9cf0d25480341b55abc89978c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mailschema-0.1.3-py3-none-any.whl

Download URL mailschema-0.1.3-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63084bfe1933de617394990f0a78d6633dbb81994784c8f997608299f778c83b
BLAKE2b-256 checksum
How to use checksums
70ea0bfb0db80e6171bf8b515bbdfe92c719ce0952b810f1dd7df1ff9338b9b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for mailschema 0.1.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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