跳转到主要内容

GitHub API的Python 3不完全包装器

项目描述

承诺

Run tests codecov PyPI Version License Python Compatibility Code style: black

GitHub API的Python 3不完全包装器。

请注意,此项目不旨在提供对GitHub API的完整抽象 - 只是为了将数据推送到GitHub仓库提供一些高级便利方法。

安装

pip install commitment

使用

生成GitHub API密钥: https://github.com/settings/tokens

from commitment import GitHubCredentials, GitHubClient

credentials = GitHubCredentials(
    repo="myuser/somerepo",
    name="myuser",
    email="someone@example.com",
    api_key="f00b42",
)

client = GitHubClient(credentials)

client.create_branch('my_new_branch', base_branch='master')
client.push_file('Hello World!', 'directory/filename.txt', 'my commit message', branch='my_new_branch')
client.open_pull_request('my_new_branch', 'title', 'body', base_branch='master')

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

commitment-3.0.1.tar.gz (3.7 kB 查看哈希)

上传时间:

构建分发

commitment-3.0.1-py3-none-any.whl (4.4 kB 查看哈希)

上传时间: Python 3

由...支持