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
Telegram Vc Video Player Bot

Telegram Video Player Bot Telegram bot project for streaming video on telegram video chat, powered by tgcalls and pyrogram Deploy to Heroku 👨‍🔧 The

Dihan Official 11 Dec 25, 2022
The first open-source PyTgCalls-based project.

Calls Music — Telegram bot + userbot for streaming audio in group calls ✍🏻 Requirements FFmpeg Python 3.7+ 🚀 Deployment 🛠 Configuration Copy exampl

Calls Music 74 Nov 19, 2022
Deploy your apps on any Cloud provider in just a few seconds

The simplest way to deploy your apps in the Cloud Deploy your apps on any Cloud providers in just a few seconds ⚡ Qovery Engine is an open-source abst

Qovery 1.9k Dec 26, 2022
Terraform wrapper to manage state across multiple cloud providers(AWS, GCP, and Azure)

Terraform Remote State Manager(tfremote) tf is a python package for managing terraform remote state for: Google(Gcloud), AWS, and Azure. It sets a def

tomarv2 1 Dec 08, 2021
Opasium AI was specifically designed for the Opasium Games discord only. It is a bot that covers the basic functions of any other bot.

OpasiumAI Opasium AI was specifically designed for the Opasium Games discord only. It is a bot that covers the basic functions of any other bot. Insta

Dan 3 Oct 15, 2021
A very tiny python api for the stock exchange tradegate.de

pytradegate A very tiny python api for the stock exchange tradegate.de The api provides the recent ask/bid data and all other data as found on the det

dunderstr aka seimen 7 Aug 24, 2022
Decode the Ontario proof of vaccination QR code

Decode the contents of the Ontario Proof of Vaccination (the "Smart Health Card QR Code") Output This is from my QR code, hopefully fully redacted alt

Wesley Ellis 4 Oct 22, 2021
Simple spam bot made in python

Simple Spam Bot A Simple and easy way to be the most hated person between your friends, All you have to do is spam the group chat using this bot until

Kareem Osama 6 Sep 05, 2022
Pydf: A modular Telegram Bot which provides Pdf Tools using PyPdf2

pyDF-Bot 🌍 Pydf - Pyrogram Document File Bot, a modular Telegram Bot which prov

HyDrix 2 Feb 18, 2022
The system to host your files on the Discord application

Distorage The system to host your files on the Discord application Documentation Documentation Distorage How to use the package You can install it wit

6 Jun 27, 2022
A telegram string extractor bot

Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github.com/FayasNoushad/String-Extract-Bot/blob/main/LIC

Fayas Noushad 12 Jul 19, 2022
Python library for the Stripe API.

Stripe Python Library The Stripe Python library provides convenient access to the Stripe API from applications written in the Python language. It incl

Stripe 1.3k Jan 03, 2023
Open API to list Viet Nam administrative divisions

Viet Nam province API Homepage: https://provinces.open-api.vn This is online tool to let my VietnamProvinces library reach more users. VietnamProvince

Nguyễn Hồng Quân 52 Dec 05, 2022
A Terminal User Interface (TUI) for automated trading with Komodo Platform's AtomicDEX-API

PytomicDEX Makerbot A Terminal User Interface (TUI) for automated trading with Komodo Platform's AtomicDEX-API Install sudo apt install wget curl jq g

6 Aug 25, 2022
The Python SDK for the BattleshAPI game

BattleshAPy The Python SDK for the BattleshAPI game Installation This library will be eventually going on PyPI, but until then, simply clone or downlo

Christopher 0 Apr 18, 2022
Random Geek Jokes REST API

Geek-Jokes A RESTful API to get random geek jokes written in Flask What is the Geek-Jokes-api? The Geek Jokes RESTful API lets you fetch a random geek

Sameer Kumar 84 Dec 15, 2022
An Anime Theme Telegram group management bot. With lot of features.

Emilia Project Emilia-Prjkt is a modular bot running on python3 with anime theme and have a lot features. Easiest Way To Deploy On Heroku This Bot is

ZenitsuID #M•R•T™ 3 Feb 03, 2022
Yes, it's true :purple_heart: This repository has 353 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serverless! If

510 Dec 28, 2022
Telephus is a connection pooled, low-level client API for Cassandra in Twisted python.

Telephus Son of Heracles who loved Cassandra. He went a little crazy, at one point. One might almost say he was twisted. Description Telephus is a con

Brandon Williams 93 Apr 29, 2021
An implementation of webhook used to notify GitHub repository events to DingTalk.

GitHub to DingTask An implementation of webhook used to notify GitHub repository events to DingTalk.

Prodesire 5 Oct 02, 2022