Code Monkey home page Code Monkey logo

bitbucket-python's Introduction

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')

Get branches for repository

response = client.get_repository_branches('REPOSITORY_SLUG')

Get tags for repository

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

bitbucket-python's People

Contributors

artemrys avatar ingmferrer avatar jessewei avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.