Skip to main content

This package enables you use the bitbucket REST-api using a simplified API

Project description

Python 3.6+ Code style: black

gitbucket is an API wrapper for Bitbucket written in Python with added features like Bitbucket pipelines while maintaining the simplicity of the source-repo. It was forked from GearPlug/bitbucket-python

Installing

pip install pygitbucket

New Features added

  • Added Bitbucket Pipelines support

Usage

from pygitbucket.client import Client

client = Client('EMAIL', 'PASSWORD') 

# Or to specify owner URL to find repo own by other user
client = Client('EMAIL', 'PASSWORD', 'Owner')

Get user information

response = client.get_user()

Get account privileges for repositories

response = client.get_privileges()

Get repositories

response = client.get_repositories()

Get repository

response = client.get_repository('REPOSITORY_SLUG')

Get branches for repository

response = client.get_repository_branches('REPOSITORY_SLUG')

Get tags for repository

response = client.get_repository_tags('REPOSITORY_SLUG')

Get pipelines for repository

response = client.get_repository_pipelines('REPOSITORY_SLUG')

Get last 10 pipelines for repository

response = client.get_latest_pipelines('REPOSITORY_SLUG')

Get components for repository

response = client.get_repository_components('REPOSITORY_SLUG')

Get milestones for repository

response = client.get_repository_milestones('REPOSITORY_SLUG')

Get versions for repository

response = client.get_repository_versions('REPOSITORY_SLUG')

Create issue

response = client.create_issue(repository_slug, title, description)

trigger pipeline deployment for branch

response = client.trigger_pipeline(repository_slug, branch_name)

Get all issues

response = client.get_issues('REPOSITORY_SLUG')

Get issue

response = client.get_issue('REPOSITORY_SLUG', 'ISSUE_ID')

Delete issue

response = client.delete_issue('REPOSITORY_SLUG', 'ISSUE_ID')

Webhooks

Create webhook

data = {
    "description": "Webhook",
    "url": "http://mywebsite.com",
    "active": True,
    "events": [
        "repo:push",
        "issue:created",
        "issue:updated"
    ]
}
response = client.create_webhook('REPOSITORY_SLUG', data)

Get all webhooks

response = client.get_webhooks('REPOSITORY_SLUG')

Get webhook

response = client.get_webhook('REPOSITORY_SLUG', 'WEBHOOK_ID')

Delete webhook

response = client.delete_webhook('REPOSITORY_SLUG', 'WEBHOOK_ID')

Requirements

  • requests

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

pygitbucket-2021.7.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

pygitbucket-2021.7.4-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pygitbucket-2021.7.4.tar.gz.

File metadata

  • Download URL: pygitbucket-2021.7.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for pygitbucket-2021.7.4.tar.gz
Algorithm Hash digest
SHA256 4e28a128c37e97d37f27ccbd115520c82cbd7ff838d8303e99d1c7ea2fb11964
MD5 3b947c5babc196a4f6c57e84d199bfd9
BLAKE2b-256 b93eabb4c21fe1ad6136873561e9af7ecacf6e4521ac5d9d5a1abdf5a65e6da0

See more details on using hashes here.

File details

Details for the file pygitbucket-2021.7.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pygitbucket-2021.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 55987bc43014f5dff5373635b871f1447483315412d5d9a1d5c68295cd0905a4
MD5 2bf8fc1705ad5ebba90a38bc5003d87c
BLAKE2b-256 b06f51ed81f0f9e1fd0c3cfad194550b4cb917a2bd83040e0e549975761f61aa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page