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:
To directly run(helpful while debugging stuff) python3 filename.py -p 5000
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c654d7955fd50337298af27d53a460c16e76c23fc4083e206730705c1341757
|
|
| MD5 |
6a6c4f6d881afefc3f894305b71ff8e7
|
|
| BLAKE2b-256 |
5b72e159e2e558213878236388d58a3d42cc752738235d39cc8d626a8651d7f7
|
File details
Details for the file ghooks-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ghooks-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
818b85ae0026d9f8c8e3907942230e1e254e0802490c91e88f2f34ea7bf87c30
|
|
| MD5 |
f4f7c6085fcdff4a6680280132e5b16d
|
|
| BLAKE2b-256 |
182fe6294c1a75dfd57c29b106570fc69b932d0ce77b670ff3160b122cfef590
|