Skip to main content

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 order
  • pop(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)

Deploy on Railway

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

Metadata

Release files for basehook 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for basehook 0.2.0
File Size Uploaded
basehook-0.2.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for basehook 0.2.0
File Interpreter ABI Platform
basehook-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / basehook-0.2.0.tar.gz

Download URL basehook-0.2.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f933903cdd9825cea6db1537917fb71fbf9c109a012e611984fd549d9af945f6
BLAKE2b-256 checksum
How to use checksums
dfd4d9b5ebe90e98b1fa5bf3f8c50566ac3e6138106e3d0974703cce1a434424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / basehook-0.2.0-py3-none-any.whl

Download URL basehook-0.2.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee498947a18c064502f0cd93d20b23d5af9fed251da00f0dde913f4e75346fbe
BLAKE2b-256 checksum
How to use checksums
2d243de33c5e0e784797b0fa8bf1d6b88e95d00b631ad503cd018a954da5eadd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page