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
Proxy-Bot - Python proxy bot for telegram

Proxy-Bot 🤖 Proxy bot between the main chat and a newcomer, allows all particip

Anton Shumakov 3 Apr 01, 2022
🖥️ Python - P1 Monitor API Asynchronous Python Client

🖥️ Asynchronous Python client for the P1 Monitor

Klaas Schoute 9 Dec 12, 2022
API generated by OpenAPI for nhentai.net

nhentai-api No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) This Python package is automati

Shikanime Deva 1 Nov 01, 2021
A python tool to Automate Whatsapp through Whatsapp web

This python tool is used to Automate Whatsapp through Whatsapp web. We can add number of contacts whom we want to send text messages on perticular time

5 Jul 21, 2022
Python Capfire API wrapper

General CampfireAPI based on Campfire web. Install pip install Campfire-API Quickstart Use it without login: from campfire_api import CampfireAPI cf

Ghost 0 Jan 03, 2022
Housing Price Prediction Using Machine Learning.

HOUSING PRICE PREDICTION USING MACHINE LEARNING DESCRIPTION Housing Price Prediction Using Machine Learning is to predict the data of housings. Here I

Shreya Shree Padhi 1 Aug 03, 2022
This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio

gateio-trading-bot-binance-announcements This Gateio x Binance cryptocurrency trading bot scans the Binance Announcements page and picks up on new coi

Andrei 1.2k Jan 01, 2023
A Python library wrapping the iFixit (Dozuki) API.

A Python library wrapping the iFixit API. Status Working, but incomplete. Fully tested and documented. Hacking I highly recommend using virtualenv: [$

James Pearson Hughes 13 May 24, 2021
1 Feb 18, 2022
Bulk convert image types with Python

Bulk Image Converter 🔥 Helper script to convert a folder's worth of images from one filetype to another, and optionally delete originals Use Setup /

1 Nov 13, 2021
Asynchronous multi-platform robot framework written in Python

NoneBot ✨ 跨平台 Python 异步机器人框架 ✨ 文档 · 安装 · 开始使用 · 文档打不开? 简介 NoneBot2 是一个现代、跨平台、可扩展的 Python 聊天机器人框架,它基于 Python 的类型注解和异步特性,能够为你的需求实现提供便捷灵活的支持。

NoneBot 3.1k Jan 04, 2023
Integrating the Daraja-Api with Python language

Mpesa-Daraja-Api Integrating the Daraja-Api with Python language. Credentials.py file This file contains the consumer key and the consumer secrete key

Morvin Ian 3 Nov 09, 2022
Send embeds using your discord personal account

Welcome to Embed Sender 👋 Send embeds using your discord personal account Install pip install -r requirements.txt Usage Put your discord token in ./

SkydenFly 11 Sep 07, 2022
IMDb + Auto + Unlimited Filter BoT

Telegram Movie Bot Features Auto Filter Manuel Filter IMDB Admin Commands Broadcast Index IMDB search Inline Search Random pics ids and User info Stat

Team AlinaX 1 Dec 03, 2021
MAASTA is a wrapper to create an Ansible inventory for MAAS instances that are provisioned by Terraform.

MAASTA is a wrapper to create an Ansible inventory for MAAS instances that are provisioned by Terraform.

Saeid Bostandoust 144 Dec 16, 2022
You cant check for conflicts until course enrolment actually opens. I wanted to do it earlier.

AcornICS I noticed that Acorn it does not let you check if a timetable is valid based on the enrollment cart, it also does not let you visualize it ea

Isidor Kaplan 2 Sep 16, 2021
Freqtrade 3commas wrapper for python

Freqtrade 3commas wrapper The aim of this project is to provide an easy way to integrate freqtrade with 3commas. The main reason someone would want to

Alex Babescu 43 Dec 17, 2022
Anti-corruption-bot - Anti corruption bot with python

anti-corruption-bot Test API (running via Flask) is currently hosted at https://

Richard Bankole 2 Feb 16, 2022
Uses discords api to see if a token has a valid payment method.

Discord Payment Checker Uses discords api to see if a token has a valid payment method. Report Bug · Request Feature Features Checks tokens Checks all

dropout 10 Dec 01, 2022
Automatic Video Library Manager for TV Shows

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic. Dependen

1.5k Dec 22, 2022