A modern Python project
Project description
Basehook
A webhook management system that groups updates by thread ID and lets you consume them either one-by-one or buffered (latest revision only).
Core Concepts
Thread-based grouping: Webhooks are grouped by thread ID. Configure JSON paths to extract thread IDs and revision numbers from any format (Slack, GitHub, Shopify, etc.).
Two consumption modes:
pop(only_last_revision=False)- Process updates one by one in orderpop(only_last_revision=True)- Buffer updates and only consume the latest revision, skipping outdated ones
Pull-based processing: Your application pulls updates via pop() instead of receiving direct webhook POSTs. Failed processing is marked as ERROR and visible in the UI for manual retry.
Quick Deploy
Docker Compose (Self-hosting)
git clone https://github.com/mehdigmira/basehook.git
cd basehook
docker-compose up -d
Access at http://localhost:8000
Railway (Cloud)
One-click deploy with PostgreSQL auto-configured.
Usage
1. Configure webhook
Visit the UI and create a webhook with thread ID and revision number paths.
2. Install client library
pip install basehook
3. Consume updates
from basehook import Basehook
basehook = Basehook(database_url="postgresql+asyncpg://...")
# Process updates one by one (in order)
async with basehook.pop("webhook-name", only_last_revision=False) as update:
if update:
process(update)
# Or buffer updates and only process latest revision
async with basehook.pop("webhook-name", only_last_revision=True) as update:
if update:
process(update) # Older revisions automatically skipped
License
MIT
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 basehook-0.2.0.tar.gz.
File metadata
- Download URL: basehook-0.2.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f933903cdd9825cea6db1537917fb71fbf9c109a012e611984fd549d9af945f6
|
|
| MD5 |
4f3796b91f14f6eee4ced772ecb9e4ea
|
|
| BLAKE2b-256 |
dfd4d9b5ebe90e98b1fa5bf3f8c50566ac3e6138106e3d0974703cce1a434424
|
File details
Details for the file basehook-0.2.0-py3-none-any.whl.
File metadata
- Download URL: basehook-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee498947a18c064502f0cd93d20b23d5af9fed251da00f0dde913f4e75346fbe
|
|
| MD5 |
cec632d3eada5949c458f4b21199c619
|
|
| BLAKE2b-256 |
2d243de33c5e0e784797b0fa8bf1d6b88e95d00b631ad503cd018a954da5eadd
|