Envelope
A thin, fluent layer over python-gnupg, cryptography, M2Crypto, 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
Release files for envelope 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envelope-2.4.0.tar.gz | 42.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envelope-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.0 kB
Release files / envelope-2.4.0.tar.gz
| Download URL | envelope-2.4.0.tar.gz |
|---|---|
| Size | 42.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55ad855f3ab31f659c4a978692ddd202fee3b3775bb8e07f0a5d50b0d484e4c1
|
|
BLAKE2b-256 checksum How to use checksums |
46fe7c3b2a7377cb3741563fa4b891b9bc788578f4986f5426a28b2292f19116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / envelope-2.4.0-py3-none-any.whl
| Download URL | envelope-2.4.0-py3-none-any.whl |
|---|---|
| Size | 46.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e48d1aeb79496bf91bf02c94fa341680c253f411bdee26d07f085a53142abc7f
|
|
BLAKE2b-256 checksum How to use checksums |
a33b713ac1ad3f9de208227b1183c3cd96390a032328e3f5d218ed66a7934ec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|