Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meetmangukiya/ghooks
Making GitHub hooks easier and faster to get up and running!
https://github.com/meetmangukiya/ghooks
ease-framework flask ghooks github github-webhooks python3 webhooks
Last synced: 2 months ago
JSON representation
Making GitHub hooks easier and faster to get up and running!
- Host: GitHub
- URL: https://github.com/meetmangukiya/ghooks
- Owner: meetmangukiya
- Created: 2016-12-18T11:03:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-06T09:23:16.000Z (over 7 years ago)
- Last Synced: 2024-10-10T09:16:28.803Z (2 months ago)
- Topics: ease-framework, flask, ghooks, github, github-webhooks, python3, webhooks
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
ghooks
======Getting started
---------------.. code:: py
import ghooks
@ghooks.events('push')
def push_event(data):
# Use/Manipulate data posted
# Actions to take when push event is triggeredghooks.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:.. code:: py
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 eventsInstallation
------------.. code:: bash
pip install ghooks