New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitbucketpy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbucketpy

Simple library for interacting with the Bitbucket Cloud API

  • 0.1.12
  • PyPI
  • Socket score

Maintainers
1

bitbucketpy

WIP Python package for interacting with Bitbucket Cloud's API.

Usage

You'll need three items:

  • EMAIL: The email address used to interact with Bitbucket.
  • PASSWORD: An API key used to authenticate with Bitbucket.
  • API_ENDPOINT: ex https://api.bitbucket.org/2.0

Interact with the repository API

import bitbucket
api = bitbucket.API(WORKSPACE, EMAIL, PASSWORD)
repository = api.get_repository(REPOSITORY_NAME)
Get branches in repository
branches = repository.branches()
for branch in branches:
    print(branch.name)
The latest commit on a branch
commit = next(branch.commits)
Find commits ahead of master
feature_branch = repository.branch('feature_branch_name')

commits = [
    commit
    for commit in feature_branch.commits({'exclude': 'master', 'pagelen': 100})
]

print(f"feature_branch_name is {len(commits)} commits ahead of master")
Find a tag in the repository
tag = repository.tag('1.0.0')
Find pipelines for a branch
pipelines = list(api.get_pipelines(
    'REPO_SLUG',
    {
        'target.branch':'BRANCH_NAME',
        'sort': '-created_on',
        'pagelen':20}))

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc