Skip to main content

ghooks

Getting started

import ghooks

@ghooks.events('push')
def push_event(data):
    # Use/Manipulate data posted
    # Actions to take when push event is triggered

ghooks.run()

To run the webhook:

  1. To directly run(helpful while debugging stuff) python3 filename.py -p 5000

  2. To run the webhook with gunicorn gunicorn webhook:app. Please ensure that you import the app with from ghooks import app.

To create different handlers for different events:

Use ghooks.events decorator. Pass the events to be handled as arguments to the decorator. Example:

from ghooks import app
import ghooks

@ghooks.events('push')
def push_handler(data):
    # Play with the data here

@ghooks.events('push', 'ping')
def push_and_ping_handler(data):
    # This will be called at both push and ping events

Installation

pip install ghooks

Metadata

Release files for ghooks 0.1.1

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

Source distribution (sdist)

Source distribution for ghooks 0.1.1
File Size Uploaded
ghooks-0.1.1.tar.gz 2.3 kB Details

Built distribution (wheel)

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

Total release size: 6.1 kB

Release files / ghooks-0.1.1.tar.gz

Download URL ghooks-0.1.1.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9c654d7955fd50337298af27d53a460c16e76c23fc4083e206730705c1341757
BLAKE2b-256 checksum
How to use checksums
5b72e159e2e558213878236388d58a3d42cc752738235d39cc8d626a8651d7f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ghooks-0.1.1-py3-none-any.whl

Download URL ghooks-0.1.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
818b85ae0026d9f8c8e3907942230e1e254e0802490c91e88f2f34ea7bf87c30
BLAKE2b-256 checksum
How to use checksums
182fe6294c1a75dfd57c29b106570fc69b932d0ce77b670ff3160b122cfef590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

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