Bitbucket Server API Wrapper
A simple wrapper for the Atlassian's Bitbucket Server / Bitbucket Datacenter (formerly Stash) REST API, written in Python.
Usage
Instantiating
Basic Auth:
import bitbucketserver
bb = bitbucketserver.BitbucketServer(
url="http://mybitbucket.company.com",
basic_auth=('username', 'password))
Personal Tokens:
bb = bitbucketserver.BitbucketServer(
url="http://mybitbucket.company.com",
bearer_token="...")
Examples
myrepo = bb.repo('project-key', 'my-repo')
commits = myrepo.commits()
new_repo = bb.create_new_repo('PROJ', "New Repo Name")
new_repo.set_group_permission("dev-team", "REPO_WRITE")
Installation
Install the library using pip:
pip install bitbucketserver
You may also clone the repository and run setup.py
manually.
Requirements
Requirements for the module should be installed automatically if installed via pip or setup.py.
Requests
This module uses the Python library Requests for communication. Install it with:
pip install requests
Version 2.4.2 or greater is required.