Skip to main content

API wrapper for Bitbucket written in Python

Project description

bitbucket-python is an API wrapper for Bitbucket written in Python

Installing

pip install bitbucket-python

Usage

from bitbucket.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')

Post repository

response = client.create_repository(data, params, repositoryName, teamName)

Get branches for repository

response = client.get_repository_branches('REPOSITORY_SLUG')

Get tags for repository

response = client.get_repository_tags('REPOSITORY_SLUG')

Get commits for a repository

response = client.get_repository_commits('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

data = {..DATA..}
response = client.create_issue('REPOSITORY_SLUG', data)

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

bitbucket_python-0.2.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitbucket_python-0.2.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bitbucket_python-0.2.4.tar.gz.

File metadata

  • Download URL: bitbucket_python-0.2.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for bitbucket_python-0.2.4.tar.gz
Algorithm Hash digest
SHA256 c92091852bd2bf6d00c4e0805c2c0d31c66abfc0e4f4a6d0c33e196550aed106
MD5 fb6f9b45a8ecf08059a7de8521fa6f21
BLAKE2b-256 52e8ef5ba4ea19121120bf6c9172ae71c9bf756a6c1323859cf24aa982a713b2

See more details on using hashes here.

File details

Details for the file bitbucket_python-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for bitbucket_python-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fcf2ab54322964c8406b623e3596c287ee889dd545577c7ef16b6895cdc9fe45
MD5 2b4100be1c6be7faa2916ff9cb68b342
BLAKE2b-256 156230ac336dbb592d2ae6ba42cf73b887f4b8c32e31f976fa26aa33794065d6

See more details on using hashes here.

Supported by

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