Skip to main content

An incomplete Python 3 wrapper for the GitHub API

Project description

commitment

Build Status Coverage Status PyPI Version License Python Support

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-2.0.1.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file commitment-2.0.1.tar.gz.

File metadata

  • Download URL: commitment-2.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for commitment-2.0.1.tar.gz
Algorithm Hash digest
SHA256 158a6de8f01b27485198c5c390d2972d51dc73d3a29ebb2722d408452ed33878
MD5 d24ce4159144267451143481e996a7fa
BLAKE2b-256 98165a96813215969594a61493526c5ca2c8f2183b13f9c09a10416134acffd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page