Routes bitbucket webhook API event payloads to easily consumable decorators.
Project description
bitbucket-webhooks-router
Routes bitbucket webhook event payloads to easily consumable decorators.
Installation
$ pip install bb-hooks-router
Quickstart
from bitbucket_webhooks_router import decorators
from bitbucket_webhooks_router import router
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route("/hooks", methods=["POST"])
def bb_webhooks_handler():
router.route(request.headers["X-Event-Key"], request.json)
return ("", 204)
@decorators.handle_repo_push
def _handle_repo_push(event):
print(f"One or more commits push to: {event.repository.name}"
Here is the full example.
Bitbucket events supported
- repo:push
- pullrequest:created
- pullrequest:updated
- pullrequest:approved
- pullrequest:unapproved
- pullrequest:fulfilled
- pullrequest:rejected
Links
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
bb-hooks-router-0.0.5.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for bb_hooks_router-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26fdee07ec523388e2e22cbda10c105023c544717b4b22cbc6969406ee725139 |
|
MD5 | e52b4582299e02ff5349fee202a2d7d5 |
|
BLAKE2b-256 | 1f8c5762071d75bac5471d7fa188d6795545974d39a56cfed729d8f28d41cc20 |