Official Python SDK for Hookfreight
Project description
hookfreight
Official Python SDK for Hookfreight.
Capture, inspect, replay, and reliably deliver webhooks with full visibility.
Installation
pip install hookfreight
Quick Start
Hookfreight Cloud
from hookfreight import Hookfreight
hf = Hookfreight(api_key="hf_sk_...")
result = hf.deliveries.list({"limit": 10})
print(result["deliveries"])
Self-Hosted
from hookfreight import Hookfreight
hf = Hookfreight(base_url="http://localhost:3030/api/v1")
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
api_key |
str |
— | API key for Hookfreight Cloud. Optional for self-hosted. |
base_url |
str |
https://api.hookfreight.com/v1 |
Base URL of the API. Override for self-hosted. |
timeout |
int |
30000 |
Request timeout in milliseconds. |
Usage
from hookfreight import Hookfreight
hf = Hookfreight(api_key="hf_sk_...")
app = hf.apps.create({"name": "My App"})
endpoint = hf.endpoints.create({
"name": "Stripe",
"app_id": app["id"],
"forward_url": "https://example.com/webhooks/stripe",
})
event = hf.events.get("evt_...")
print(event["body"])
stats = hf.deliveries.queue_stats()
print(stats)
Error Handling
from hookfreight import Hookfreight, NotFoundError, ValidationError, ConnectionError
hf = Hookfreight(api_key="hf_sk_...")
try:
hf.apps.get("app_nonexistent")
except NotFoundError:
print("App not found")
except ValidationError as err:
print(err.errors)
except ConnectionError as err:
print(err)
Examples
examples/basic_usage.pyexamples/manage_endpoints.pyexamples/retry_failed_deliveries.pyexamples/monitor_queue.py
Run an example:
HOOKFREIGHT_API_KEY=hf_sk_... python examples/basic_usage.py
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 hookfreight-0.1.2.tar.gz.
File metadata
- Download URL: hookfreight-0.1.2.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfcbec8f288e837d723473657b19828056a6d0585175e8d70ba069728a178099
|
|
| MD5 |
564a830761b3751ee4919ff5cfdc3e2b
|
|
| BLAKE2b-256 |
224dc2d767c34efcc06acaca1d04bf19f276e03c35897d165ca98737e3d37431
|
Provenance
The following attestation bundles were made for hookfreight-0.1.2.tar.gz:
Publisher:
pypi-publish.yml on HookFreight/hookfreight-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hookfreight-0.1.2.tar.gz -
Subject digest:
bfcbec8f288e837d723473657b19828056a6d0585175e8d70ba069728a178099 - Sigstore transparency entry: 1004668315
- Sigstore integration time:
-
Permalink:
HookFreight/hookfreight-py@8c734e8d2cc1924cefe93d69a9be1a26e572b1c6 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/HookFreight
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@8c734e8d2cc1924cefe93d69a9be1a26e572b1c6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hookfreight-0.1.2-py3-none-any.whl.
File metadata
- Download URL: hookfreight-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.8 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 |
4aaad681ca23c7c6d762d1b0a9109082f1531b7550e18fa459be56d17b9bb6b7
|
|
| MD5 |
fe04975b458ed2ea0c490f54286e20d9
|
|
| BLAKE2b-256 |
6ea964d9324da80994f737b6db2d305eda3dba40f7ea3ff398fae7d9b0453234
|
Provenance
The following attestation bundles were made for hookfreight-0.1.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on HookFreight/hookfreight-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hookfreight-0.1.2-py3-none-any.whl -
Subject digest:
4aaad681ca23c7c6d762d1b0a9109082f1531b7550e18fa459be56d17b9bb6b7 - Sigstore transparency entry: 1004668316
- Sigstore integration time:
-
Permalink:
HookFreight/hookfreight-py@8c734e8d2cc1924cefe93d69a9be1a26e572b1c6 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/HookFreight
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@8c734e8d2cc1924cefe93d69a9be1a26e572b1c6 -
Trigger Event:
push
-
Statement type: