Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for ghooks, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size ghooks-0.1.1-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size ghooks-0.1.1.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page