Postmarker
Python client library for Postmark API.
Installation
Postmarker can be obtained with pip:
$ pip install postmarker
Usage example
NOTE:
The attributes of all classes are provided as is, without transformation to snake case. We don’t want to introduce new names for existing entities.
Send single email:
>>> from postmarker.core import PostmarkClient
>>> postmark = PostmarkClient(server_token='API_TOKEN')
>>> postmark.emails.send(
From='sender@example.com',
To='receiver@example.com',
Subject='Postmark test',
HtmlBody='<html><body><strong>Hello</strong> dear Postmark user.</body></html>'
)
Send batch:
>>> postmark.emails.send_batch(
{
'From': 'sender@example.com',
'To': 'receiver@example.com',
'Subject': 'Postmark test',
'HtmlBody': '<html><body><strong>Hello</strong> dear Postmark user.</body></html>',
},
{
'From': 'sender2@example.com',
'To': 'receiver2@example.com',
'Subject': 'Postmark test 2',
'HtmlBody': '<html><body><strong>Hello</strong> dear Postmark user.</body></html>',
}
)
Setup an email:
>>> email = postmark.emails.Email(
From='sender@example.com',
To='receiver@example.com',
Subject='Postmark test',
HtmlBody='<html><body><strong>Hello</strong> dear Postmark user.</body></html>'
)
>>> email['X-Accept-Language'] = 'en-us, en'
>>> email.attach('/home/user/readme.txt')
>>> email.attach_binary(content=b'content', filename='readme.txt')
>>> email.send()
There are a lot of features available. Check it out in our documentation! Here’s just a few of them:
Support for sending Python email instances.
Bounces, Domains, Messages, Templates, Sender signatures, Status, Stats & Server API.
Django email backend.
Tornado helper.
Spam check API.
Wrappers for Bounce, Inbound, Open and Delivery webhooks.
Documentation
You can view the documentation online at:
Or you can look at the docs/ directory in the repository.
Python support
Postmarker supports CPython 3.6 - 3.10 and PyPy 3.7 & 3.8.
Thanks
Many thanks to Shmele and lobziik for their reviews and advice :)
Metadata
Release files for postmarker 1.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 | Provenance | |
|---|---|---|---|---|
| postmarker-1.0.tar.gz | 21.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| postmarker-1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.8 kB
Release files / postmarker-1.0.tar.gz
| Download URL | postmarker-1.0.tar.gz |
|---|---|
| Size | 21.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e735303fdf8ede667a1c6e64a95a96e97f0dabbeca726d0ae1f066bdd799fe34
|
|
BLAKE2b-256 checksum How to use checksums |
5179a527c6e91bc1c6980bc779b83249f59bf1cba8b259147c799934297cc7a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / postmarker-1.0-py3-none-any.whl
| Download URL | postmarker-1.0-py3-none-any.whl |
|---|---|
| Size | 24.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fa49f236c7193650896cbf31bbfac34043e352574c6c7e3e2ad2b954704f064
|
|
BLAKE2b-256 checksum How to use checksums |
a14b045369491569fda223d2e0bc821534de14278dd4facdb386405ea17b9d80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Security for postmarker 1.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.