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='<strong>Hello</strong> dear Postmark user.'
)
Send batch:
>>> postmark.emails.send_batch(
{
'From': 'sender@example.com',
'To': 'receiver@example.com',
'Subject': 'Postmark test',
'HtmlBody': '<strong>Hello</strong> dear Postmark user.',
},
{
'From': 'sender2@example.com',
'To': 'receiver2@example.com',
'Subject': 'Postmark test 2',
'HtmlBody': '<strong>Hello</strong> dear Postmark user.',
}
)
Setup an email:
>>> email = postmark.emails.Email(
From='sender@example.com',
To='receiver@example.com',
Subject='Postmark test',
HtmlBody='<strong>Hello</strong> dear Postmark user.'
)
>>> 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.
- Server APIs: Bounces, Messages, Message Streams, Suppressions, Templates with layouts, Server, Stats and Triggers.
- Account APIs: Domains, Sender signatures, Servers and pushing templates between servers.
- Status API.
- Django email backend.
- Tornado helper.
- Spam check API.
- Wrappers for Bounce, Inbound, Open and Delivery webhooks.
pytestfixtures to mock Postmark API in tests.- Type annotations, with a
py.typedmarker.
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.10 - 3.15 and PyPy 3.11. The Django email backend supports Django 5.2, 6.0 and 6.1.
Thanks
Many thanks to Shmele and lobziik for their reviews and advice :)
Metadata
Release files for postmarker 2.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 | Actions |
|---|---|---|---|---|
| postmarker-2.0.tar.gz | 69.5 kB | With provenance | Details for postmarker-2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| postmarker-2.0-py3-none-any.whl | Python 3 | none | any | Details for postmarker-2.0-py3-none-any.whl |
Total release size: 101.6 kB
Release files / postmarker-2.0.tar.gz
| Download URL | postmarker-2.0.tar.gz |
|---|---|
| Size | 69.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b6928f8fc554909ddfcd312449410faab1f49225091e97f0d3a56f52600478d
|
|
BLAKE2b-256 checksum How to use checksums |
605ef5da2483f9f83c4ddb9fdaa42dd043f9acf6ba041bf07ae8ba4340fff7e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / postmarker-2.0-py3-none-any.whl
| Download URL | postmarker-2.0-py3-none-any.whl |
|---|---|
| Size | 32.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3afe608c22e73dd0d4b2deeb6295cfc99bb2fead446db4cc7ae84a8eeb836ac4
|
|
BLAKE2b-256 checksum How to use checksums |
e4eff96cc3adafd9cb221197e5527b673468f5fb472002ee9b165fa516479202
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for postmarker 2.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for postmarker-2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA 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.