Skip to main content

An incomplete Python 3 wrapper for the GitHub API

Project description

commitment

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

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')

Versioning

commitment follows semantic versioning.

From version 4 onwards, commitment will drop compatibility with unsupported python versions without incrementing the major version. This is in line with common practice in the python community.

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commitment-4.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commitment-4.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for commitment-4.1.1.tar.gz
Algorithm Hash digest
SHA256 56b49bd473576caf44b936113ad19441c315d67bde9fd85197dd42c475ddaab4
MD5 e2d5621d95c8250af0c7c848b6fee791
BLAKE2b-256 4001206cd6d206ef8e41dbcfe3cf82798ad312b1b1312256219396ba40682b64

See more details on using hashes here.

Provenance

The following attestation bundles were made for commitment-4.1.1.tar.gz:

Publisher: publish.yml on chris48s/commitment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file commitment-4.1.1-py3-none-any.whl.

File metadata

  • Download URL: commitment-4.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for commitment-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12b24e14f7f6948e2c5b2d32e2ca8c7ccd6f00dcff417470de2574743778ebad
MD5 cd928b970703b44a90b8b3dc39228992
BLAKE2b-256 fbe259652974f907147c2b8eca9244819bf2c5e843d9cc400dc0f6fb0caccce6

See more details on using hashes here.

Provenance

The following attestation bundles were made for commitment-4.1.1-py3-none-any.whl:

Publisher: publish.yml on chris48s/commitment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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