An incomplete Python 3 wrapper for the GitHub API
Project description
commitment
An incomplete Python 3 wrapper for the GitHub API.
Note this project does not aim to provide a complete abstraction over the GitHub API - just a few high-level convenience methods for pushing data to a GitHub repo.
Installation
pip install commitment
Usage
Generate a GitHub API key: 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')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
commitment-3.0.1.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file commitment-3.0.1.tar.gz
.
File metadata
- Download URL: commitment-3.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fe73698d550dc0acc4884587481ebb561fdb76fa2f79d91228f5b4506b250d8 |
|
MD5 | a4857932dc6d86b69a7d6c1c591663ef |
|
BLAKE2b-256 | 42ecfe9f1a252d03926de1f496018003caa4d1d58882f69adfc7f8e54954aec0 |
File details
Details for the file commitment-3.0.1-py3-none-any.whl
.
File metadata
- Download URL: commitment-3.0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08577d6caef8b8bed6375f0c97343073eeac500f2568b66419f626a94a9be5e8 |
|
MD5 | 99f27daadb04e72405a0ed06fd52bac9 |
|
BLAKE2b-256 | 1a3b62d3e5b57e91316085d1daaefcf3b4fb0980e9cf3105da88c536cdbad756 |