py-postdmarc
A Python interface for the Postmark DMARC monitoring API.
Table of Contents
Example
set POSTMARK_API_KEY="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
postdmarc get_record
postdmarc export_all_reports --from_date 2020-01-01 --to_date 2020-01-08 --filepath reports.json
Installation
pip install py-postdmarc
Clone
Clone this repo to your local machine using https://github.com/scuriosity/py-postdmarc, then install locally with pip:
git clone https://github.com/scuriosity/py-postdmarc
pip install .
Features
Implements the 10 API methods provided by the API Documentation:
- Create a record
- Get a record
- Update a record
- Get DNS snippet
- Verify DNS
- Delete a record
- List DMARC reports
- Get a specific DMARC report by ID
- Recover API token
- Rotate API token
As well as
- Export all forensic reports within a given timeframe to a JSON file.
Usage
API Key
For most commands, your Postmark API key is required. The py-postdmarc package can load your API key either from the POSTMARK_API_KEY environment variable or the file PM_API.key in the package root. The API key should be a hexadecimal string like this:
aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
py-postdmarc/
+-- postdmarc/
| +-- __init__.py
| +-- pdm_exceptions.py
| â””-- postdmarc.py
|
+-- tests/
| +-- __init__.py
| +-- test_meta.py
| â””-- test_postdmarc.py
|
+-- license.txt
+-- PM_API.key
+-- readme.md
+-- requirements.txt
+-- setup.py
If the key isn't set in one of these two locations, an APIKeyMissingError will be raised.
Syntax
Create a record
postdmarc create_record --email EMAIL@domain.com --domain domain.com
Get a record
postdmarc get_record
Update a record
postdmarc update_record --email EMAIL@domeng.com
Get DNS snippet
postdmarc get_dns_snippet
Verify DNS
postdmarc verify_dns
Delete a record
postdmarc delete_record
List DMARC reports
postdmarc list_reports --from_date 01-01-2020 --to_date 01-02-2020
Optional flags for "after", "before" and "reverse" are provided.
Get a specific DMARC report by ID
postdmarc get_report --id 1234567
postdmarc get_report --id 1234567 --fmt xml
Recover API token
postdmarc recover_token --owner domain.com
Rotate API token
postdmarc rotate_token
Export all forensic reports
postdmarc export_all_reports --from_date 2020-01-01 --to_date 2020-01-08 --filepath reports.json
Contributing
Issues and pull requests are welcome. Create a new pull request using https://github.com/scuriosity/py-postdmarc/compare
License
- MIT license
- Copyright 2020 © Scuriosity.
Metadata
Release files for py-postdmarc 0.0.2
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 |
|---|---|---|---|---|
| py-postdmarc-0.0.2.tar.gz | 10.1 kB | Without provenance | Details for py-postdmarc-0.0.2.tar.gz |
Release files / py-postdmarc-0.0.2.tar.gz
| Download URL | py-postdmarc-0.0.2.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96471e18ff34dfec7f429ab7b440fa3abb21193219241c7ebac3c9125a9a3923
|
|
BLAKE2b-256 checksum How to use checksums |
7b0377418820aff119e381a6a676c4f1a899728f736ec7de4be0942f8258eb40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for py-postdmarc 0.0.2
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.