Skip to main content

bitbucket-webhooks

Build Status

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

Release files for bitbucket-webhooks 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitbucket-webhooks 0.0.11
File Size Uploaded
bitbucket-webhooks-0.0.11.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bitbucket-webhooks 0.0.11
File Interpreter ABI Platform
bitbucket_webhooks-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / bitbucket-webhooks-0.0.11.tar.gz

Download URL bitbucket-webhooks-0.0.11.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a18180c2aecb78f318b17d069b72614b2902ec45943de81bbda0da0a427c3aa3
BLAKE2b-256 checksum
How to use checksums
e18e56cc7ce8f48a74882ffad323a0df21e4d7e3e38a170d0c3ca182cc85f888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

Release files / bitbucket_webhooks-0.0.11-py3-none-any.whl

Download URL bitbucket_webhooks-0.0.11-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
374bad09181ff1f1e11b91442f698be5164ada00b50d19a6f479ded067f3e23f
BLAKE2b-256 checksum
How to use checksums
61e6da9b32f1f8fa3870342e9e78a595fabce7f5bb94cd1ca773a8d74abf257a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page