https://github.com/chris48s/commitment
:octocat: An incomplete Python 3 wrapper for the GitHub API
https://github.com/chris48s/commitment
Last synced: 3 months ago
JSON representation
:octocat: An incomplete Python 3 wrapper for the GitHub API
- Host: GitHub
- URL: https://github.com/chris48s/commitment
- Owner: chris48s
- License: mit
- Created: 2017-10-28T20:36:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-11T19:19:25.000Z (6 months ago)
- Last Synced: 2025-03-24T06:51:54.001Z (3 months ago)
- Language: Python
- Homepage: https://pypi.org/pypi/commitment/
- Size: 373 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# commitment
[](https://github.com/chris48s/commitment/actions/workflows/test.yml)
[](https://codecov.io/gh/chris48s/commitment)



An incomplete Python 3 wrapper for the [GitHub API](https://developer.github.com/v3/).
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
```python
from commitment import GitHubCredentials, GitHubClientcredentials = GitHubCredentials(
repo="myuser/somerepo",
name="myuser",
email="[email protected]",
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')
```