Skip to main content

Trueform Python SDK

The official Python client for the Trueform email validation API.

Python SDK documentation | API reference

Install

pip install trueform-cloud

Requires Python 3.10 or newer. The SDK has no runtime dependencies and requires no API key.

Quickstart

from trueform_cloud import Trueform

trueform = Trueform()
validation = trueform.validations.create(email="user@example.com")

if validation.is_deliverable:
    print("Email looks good")

Handle validation results

Validation results are frozen, slotted dataclasses with complete type annotations:

if validation.did_you_mean:
    print(f"Did you mean {validation.did_you_mean}?")

if validation.is_disposable:
    print("Ask for a permanent email address")

Available attributes:

  • email
  • is_valid_format
  • is_freemail
  • is_disposable
  • has_mx_records
  • did_you_mean
  • is_deliverable

is_deliverable is a domain-level verdict. It does not prove that a specific mailbox exists.

Configure the client

Timeout values and retry delays use seconds:

trueform = Trueform(timeout=5, max_retries=2)

Override options for one request:

validation = trueform.validations.create(
    email="user@example.com",
    timeout=2,
    max_retries=0,
)

The client retries connection failures, timeouts, rate limits, and server errors. A Retry-After response header controls the delay when present. Use base_url= to point the client at a different Trueform-compatible endpoint.

Errors

from trueform_cloud import InvalidRequestError, RateLimitError, Trueform

trueform = Trueform()

try:
    validation = trueform.validations.create(email="user@example.com")
except RateLimitError as error:
    print(f"Retry after {error.retry_after} seconds")
except InvalidRequestError as error:
    print(error)

Exported exceptions:

  • TrueformError
  • APIError
  • InvalidRequestError
  • RateLimitError
  • ConnectionError
  • TimeoutError

Exceptions expose code, status, request_id, and retry_after when available.

Development

python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
python -m ruff check .
python -m mypy
python -m pytest
python -m build
python -m twine check dist/*
python scripts/check_package.py dist/*

Read CONTRIBUTING.md before opening a pull request. Report vulnerabilities through the process in SECURITY.md.

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trueform_cloud-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trueform_cloud-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file trueform_cloud-0.1.0.tar.gz.

File metadata

  • Download URL: trueform_cloud-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trueform_cloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b1fb27770e1fc1ad68667a755659b1d2c0c54e88d4d106e107c8285f54ca0246
MD5 797ff1655105d14543bff7e29b930c80
BLAKE2b-256 c518c079983f9b7b5e4ae43a9e7530e5e18ce22db86b5c91f46d502245168b2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for trueform_cloud-0.1.0.tar.gz:

Publisher: release.yml on True-Form-Cloud/trueform-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trueform_cloud-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trueform_cloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trueform_cloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1daa0738636820f7ad5e05220e99c36ac674c14ba8df7724c8b3ae0b5f03de9f
MD5 a55e280407fb23ca70d4e53f4fbe4085
BLAKE2b-256 9109a9edd6c5f9925f7e2624850194f6a0d7f1c0852035b0a17d30840f6969c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for trueform_cloud-0.1.0-py3-none-any.whl:

Publisher: release.yml on True-Form-Cloud/trueform-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page