Bitbucket Server API Wrapper

Overview

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.

Comments
  • Add Method to Create New Comment on Pull Request

    Add Method to Create New Comment on Pull Request

    I've only addressed the method itself, and some little README formatting stuff. I'm not sure exactly how I should "plug into" the testing framework, or what needs to be done there. Could you provide some recommendations on how I can add to it?

    Thank you!

    opened by JoeStanleySEL 3
  • Additional parameter description allowed in create_repo api request

    Additional parameter description allowed in create_repo api request

    Hello, For create_repo (and I guess for some other), the bitbucket API allow an additional field description which you can add in your payload dict in the file bitbucketserver/bitbucketserver.py

    BR Pierrick

    enhancement 
    opened by tradjincal 3
  • Feature/build and pr comment methods

    Feature/build and pr comment methods

    Made the following changes:

    • Breaking change: changed existing post_build_status method to post_build_status_legacy.
    • Replaced existing post_build_status method with a new one that supports the new build status endpoint. This changed the function arguments.
    • Added several new methods for interacting with PR Comments and and Tasks.
    • Removed BuildStatisticResource object. The related methods now just return the direct dictionary.
    • Added PullRequestCommentResource and changed TaskResource to inherit from that object.
    • Coverage Unit Test changes to support those changes.
    opened by JasonKempSEL 2
  • Need help for use SettingsResource object

    Need help for use SettingsResource object

    Hello, I try to use the repo_branch_permissionsmethod which return a SettingsResource object but I did not understand how to use it. SettingsResource is just derivated from BitbucketObject but I am not sure which attribute should I access. Any suggestion?

    BR

    question 
    opened by tradjincal 2
  • Add Github Actions Workflow to Run `unittest` and Generate Coverage Badge

    Add Github Actions Workflow to Run `unittest` and Generate Coverage Badge

    Not sure how terribly important this is, but I find these sorts of automated workflows to be helpful in terms of general project visibility. This documents the basics of running tests manually, as well as automating the process with a Github action that also generates a code-coverage badge.

    opened by JoeStanleySEL 1
Releases(v1.2.0)
  • v1.2.0(Dec 6, 2022)

    What's Changed

    • Add Method to Create New Comment on Pull Request by @JoeStanleySEL in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/5
    • Add Github Actions Workflow to Run unittest and Generate Coverage Badge by @JoeStanleySEL in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/6
    • Feature/build and pr comment methods by @JasonKempSEL in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/8
    • Breaking change: arguments for post_build_status changed to support the new REST endpoint. Old method and arguments is available under the new name post_build_status_legacy.
    • v1.2.0 release by @JasonKempSEL in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/9

    New Contributors

    • @JoeStanleySEL made their first contribution in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/5

    Full Changelog: https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/compare/v1.1.0...v1.2.0

    Source code(tar.gz)
    Source code(zip)
    bitbucketserver-1.2.0-py3-none-any.whl(34.08 KB)
  • v1.1.0(Feb 1, 2022)

    What's Changed

    • Added description to repo creation/update methods. by @JasonKempSEL in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/2
    • Added pull_request_diffs() method by @JasonKempSEL in https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/pull/4

    Full Changelog: https://github.com/Schweitzer-Engineering-Laboratories/bitbucketserver/compare/v1.0.0...v1.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
Schweitzer Engineering Laboratories
Schweitzer Engineering Laboratories
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

Richard Kolkovich 904 Jan 2, 2023
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% api coverage most of the codebase is documented

null 7 Dec 11, 2022
Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

null 16 Mar 29, 2022
An API Wrapper for Gofile API

Gofile2 from gofile2 import Gofile g_a = Gofile() print(g_a.upload(file="/home/itz-fork/photo.png")) An API Wrapper for Gofile API. About API Gofile

I'm Not A Bot #Left_TG 16 Dec 10, 2022
A simple API wrapper for the Tenor API

Gifpy A simple API wrapper for the Tenor API Installation Python 3.9 or higher is recommended python3 -m pip install gifpy Clone repository: $ git cl

Juan Ignacio Battiston 4 Dec 22, 2021
A Python API wrapper for the Twitter API!

PyTweet PyTweet is an api wrapper made for twitter using twitter's api version 2! Installation Windows py3 -m pip install PyTweet Linux python -m pip

TheFarGG 1 Nov 19, 2022
Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

Aaron DeVera 2 May 11, 2022
An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

Izhar Ahmad 14 Jan 3, 2022
This an API wrapper library for the OpenSea API written in Python 3.

OpenSea NFT API Python 3 wrapper This an API wrapper library for the OpenSea API written in Python 3. The library provides a simplified interface to f

Attila Tóth 159 Dec 26, 2022
YARSAW is an Async Python API Wrapper for the Random Stuff API.

Yet Another Random Stuff API Wrapper - YARSAW YARSAW is an Async Python API Wrapper for the Random Stuff API. This module makes it simpler for you to

Bruce 6 Mar 27, 2022
A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key).

fulltmdb A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key). Installation Use the package manager pip t

Jacob Hale 2 Sep 26, 2021
EpikCord.py - This is an API Wrapper for Discord's API for Python

EpikCord.py - This is an API Wrapper for Discord's API for Python! We've decided not to fork discord.py and start completely from scratch for a new, better structuring system!

EpikHost 28 Oct 10, 2022
An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% API coverage Most of the codebase is documented

null 7 Dec 11, 2022
A simple Python API wrapper for Cloudflare Stream's API.

python-cloudflare-stream A basic Python API wrapper for working with Cloudflare Stream. Arbington.com started off using Cloudflare Stream. We used the

Arbington 3 Sep 8, 2022
An API wrapper for Henrik's Unofficial VALORANT API

ValorantAPI.py An API wrapper for Henrik's Unofficial VALORANT API Warning!! This project is still in beta and only contains barely anything yet. If y

Jakkaphat Chalermphanaphan 0 Feb 4, 2022