Zero-dependency Python client for the Posthorn HTTP API
Project description
python-posthorn
Zero-dependency Python client for Posthorn's HTTP API.
Install locally
pip install -e ./python-posthorn
Basic usage
from python_posthorn import PosthornClient
client = PosthornClient(
"http://localhost:8888",
"your-api-key",
default_path="/api/transactional",
)
response = client.send({"message": "hello"})
print(response)
[!NOTE] The endpoint path and required payload fields are configured per deployment and not fixed by this client. For example, the deployment at
rootmab.monperrus.net:8088exposes its send endpoint at/api/sendand requires bothmessageandsubject_line:client = PosthornClient( "http://rootmab.monperrus.net:8088", "your-api-key", default_path="/api/send", ) response = client.send({"message": "hello", "subject_line": "Greetings"})Check with the operator of your Posthorn instance for its configured path and required fields.
Features
GET /healthzGET /metrics- authenticated JSON send requests
Idempotency-Keysupport- typed
200success and dry-run responses - typed
422validation errors - explicit exception classes for
401,409,429, and502
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_posthorn-0.3.0-py3-none-any.whl.
File metadata
- Download URL: python_posthorn-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2208f982735438ba67948583685acb4503281d81032a340e8978ae4426efb604
|
|
| MD5 |
bb7b35f7c8e3f9dbe3a820bd7190314f
|
|
| BLAKE2b-256 |
cce729349ea75f6b60dcbb892202a2890e097e4180c6dd9fe0d28390f60c15f6
|
Provenance
The following attestation bundles were made for python_posthorn-0.3.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on monperrus/python-posthorn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_posthorn-0.3.0-py3-none-any.whl -
Subject digest:
2208f982735438ba67948583685acb4503281d81032a340e8978ae4426efb604 - Sigstore transparency entry: 1813005919
- Sigstore integration time:
-
Permalink:
monperrus/python-posthorn@4c3283e1d572f460533cb79b1dcd45abd1983060 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/monperrus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4c3283e1d572f460533cb79b1dcd45abd1983060 -
Trigger Event:
push
-
Statement type: