此包使您能够使用简化的API使用bitbucket RESTapi

pygitbucket的Python项目详细描述


gitbucket是一个用Python编写的Bitbucket API包装器,它添加了Bitbucket管道等特性,同时保持了源repo的简单性。 它是从GearPlug/bitbucket-python分叉的

安装

pip install pygitbucket

新增功能

  • [x] 增加了Bitbucket管道支持

使用

^{pr2}$

获取用户信息

response = client.get_user()

获取存储库的帐户权限

response = client.get_privileges()

获取存储库

response = client.get_repositories()

获取存储库

response = client.get_repository('REPOSITORY_SLUG')

获取存储库的分支

response = client.get_repository_branches('REPOSITORY_SLUG')

获取存储库的标记

response = client.get_repository_tags('REPOSITORY_SLUG')

获取存储库的管道

response = client.get_repository_pipelines('REPOSITORY_SLUG')

获取存储库的最后10条管道

response = client.get_latest_pipelines('REPOSITORY_SLUG')

获取存储库的组件

response = client.get_repository_components('REPOSITORY_SLUG')

获取存储库的里程碑

response = client.get_repository_milestones('REPOSITORY_SLUG')

获取存储库的版本

response = client.get_repository_versions('REPOSITORY_SLUG')

创建问题

response = client.create_issue(repository_slug, title, description)

触发分支的管道部署

response = client.trigger_pipeline(repository_slug, branch_name)

获取所有问题

response = client.get_issues('REPOSITORY_SLUG')

获取问题

response = client.get_issue('REPOSITORY_SLUG', 'ISSUE_ID')

删除问题

response = client.delete_issue('REPOSITORY_SLUG', 'ISSUE_ID')

Webhooks

创建webhook

data = {
    "description": "Webhook",
    "url": "http://mywebsite.com",
    "active": True,
    "events": [
        "repo:push",
        "issue:created",
        "issue:updated"
    ]
}
response = client.create_webhook('REPOSITORY_SLUG', data)

获取所有网络挂钩

response = client.get_webhooks('REPOSITORY_SLUG')

获取webhook

^{pr21}$

删除webhook

response = client.delete_webhook('REPOSITORY_SLUG', 'WEBHOOK_ID')

要求

  • 请求

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
相对于框架java窗口的鼠标位置错误   Java 8流peek api   java将数据附加到文件中   java使用ExoPlayer 2.8播放播放列表中的特定文件   JavaSpring国际化:如何动态设置语言环境值   java如何在mysql中实现两个表之间的两个关联   java在gradle可执行jar文件中包含运行时参数   surefire插件中的java maven多套测试套件   java试图理解堆分析以确定内存泄漏或所需的大量内存   java识别字符串有数字   数组如何解决错误“java.lang.ArrayIndexOutOfBoundsException:5”   java Swt文件对话框选择的文件太多?   java此登录代码易受SQL注入攻击吗?   Java[3]中的文件<identifier>预期编译错误   java如何在spring webflux中发送列表   jar中未找到java文件异常   如何在java中合并2D数组?   java如何评测本机JNI库