Skip to main content

Envelope

Build Status Downloads

A thin, fluent layer over python-gnupg, cryptography, smtplib, magic and email — their common use cases merged into a single object. Tired of forgetting how to sign a message correctly? You do not need to know everything about GPG or S/MIME, you do not have to bother with importing keys, you do not have to hassle with reconnecting to an SMTP server, and you do not have to study what every header means just to let your users unsubscribe via a URL. You insert a message, attachments and inline images and get back signed and/or encrypted output — written to a file or sent straight to your recipients' e-mail. Just a single line of code, as the examples below show.

Envelope("my message")
    .subject("hello world")
    .to("example@example.com")
    .attach(file_contents, name="attached-file.txt")
    .smtp("localhost", 587, "user", "pass", "starttls")
    .signature()
    .send()
# Inline image
Envelope("My inline image: <img src='cid:image.jpg' />")
    .attach(path="image.jpg", inline=True)

# Load a message and read its attachments
Envelope.load(path="message.eml").attachments()
# in bash: envelope --load message.eml --attachments

Documentation

  • Installation — PyPI/GitHub install, GPG/S-MIME prerequisites, bash completion.
  • Usage — the CLI, the fluent interface and the one-liner module call.
  • Reference — every setter, in all three interfaces:
    • Overview — notation used below, "any attainable contents".
    • Input / Output — message, output.
    • Recipients — from, to, cc, bcc, reply-to, from_addr.
    • Sending — send, subject, date, smtp, attachments, mime, headers.
    • Ciphering — choosing GPG/S-MIME, signing, encrypting.
    • Supportive — recipients(), copy(), preview, check, load, Address.
    • Experimental — _report(), _check_auth().
    • Envelope object — converting to str/bool, object equality.
  • Examples — signing/encrypting, sending, attachments, inline images, a complex example.
  • Related affairs — configuring an SMTP server, GPG, S/MIME, and SPF/DKIM/DMARC.
  • Changelog

Metadata

Release files for envelope 2.5.0

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

Source distribution (sdist)

Source distribution for envelope 2.5.0
File Size Uploaded Provenance
envelope-2.5.0.tar.gz 45.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 99.9 kB

Release files / envelope-2.5.0.tar.gz

Download URL envelope-2.5.0.tar.gz
Size 45.9 kB
Tags Source
SHA-256 checksum
How to use checksums
02a29799f39320d7edf249384a255890fa9dff00d64ac6651ab52617cf185202
BLAKE2b-256 checksum
How to use checksums
50369d2b2aeb7b4f2d5af76d8ca6dbe2fc042952c5b3f8b8a1ea10ac8832b99c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / envelope-2.5.0-py3-none-any.whl

Download URL envelope-2.5.0-py3-none-any.whl
Size 54.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c61c3af8be6281f7dce4b5458364c329723ce2b33bb87090f7620ada0747e87a
BLAKE2b-256 checksum
How to use checksums
62ecb7a9af3a026f5d8e884f4b584c5e67e7cd63378c99331957980abf429056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for envelope 2.5.0

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.

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files No provenance

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