bitbucket-webhooks 0.0.11

Last updated:

0 purchases

bitbucket-webhooks 0.0.11 Image
bitbucket-webhooks 0.0.11 Images
Add to Cart

Description:

bitbucketwebhooks 0.0.11

bitbucket-webhooks

Python library that makes bitbucket webhook API event payloads available via decorators with payload serialized into python objects.
Installation
$ pip install bitbucket-webhooks

Quickstart
from flask import Flask
from flask import request

from bitbucket_webhooks import event_schemas
from bitbucket_webhooks import hooks
from bitbucket_webhooks import router

app = Flask(__name__)


@app.route("/hooks", methods=["POST"])
def bb_webhooks_handler():
router.route(request.headers["X-Event-Key"], request.json)
return ("", 204)


@hooks.repo_push
def _handle_repo_push(event: event_schemas.RepoPush):
print(f"One or more commits pushed to: {event.repository.name}"

Here is the full example.
Webhook events supported

repo:push
pullrequest:created
pullrequest:updated
pullrequest:approved
pullrequest:unapproved
pullrequest:fulfilled
pullrequest:rejected
pullrequest:comment_created
pullrequest:comment_updated
pullrequest:comment_deleted

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.