Skip to main content

GitHub hooks made simpler to handle!

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghooks-0.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

ghooks-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file ghooks-0.1.1.tar.gz.

File metadata

  • Download URL: ghooks-0.1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ghooks-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c654d7955fd50337298af27d53a460c16e76c23fc4083e206730705c1341757
MD5 6a6c4f6d881afefc3f894305b71ff8e7
BLAKE2b-256 5b72e159e2e558213878236388d58a3d42cc752738235d39cc8d626a8651d7f7

See more details on using hashes here.

File details

Details for the file ghooks-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ghooks-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 818b85ae0026d9f8c8e3907942230e1e254e0802490c91e88f2f34ea7bf87c30
MD5 f4f7c6085fcdff4a6680280132e5b16d
BLAKE2b-256 182fe6294c1a75dfd57c29b106570fc69b932d0ce77b670ff3160b122cfef590

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page