Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chris48s/commitment
:octocat: An incomplete Python 3 wrapper for the GitHub API
https://github.com/chris48s/commitment
Last synced: 24 days 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T14:38:20.000Z (about 2 months ago)
- Last Synced: 2024-09-09T16:14:28.705Z (about 2 months ago)
- Language: Python
- Homepage: https://pypi.org/pypi/commitment/
- Size: 324 KB
- Stars: 0
- Watchers: 3
- 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
[![Run tests](https://github.com/chris48s/commitment/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/chris48s/commitment/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/chris48s/commitment/branch/master/graph/badge.svg?token=4BL8HL7913)](https://codecov.io/gh/chris48s/commitment)
![PyPI Version](https://img.shields.io/pypi/v/commitment.svg)
![License](https://img.shields.io/pypi/l/commitment.svg)
![Python Compatibility](https://img.shields.io/badge/dynamic/json?query=info.requires_python&label=python&url=https%3A%2F%2Fpypi.org%2Fpypi%2Fcommitment%2Fjson)
![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)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')
```