Shell Command - gh¶
gh is GitHub’s official command-line tool. Persoanlly, I’m not a fan of gh mainly because I’m not a fan of writing complicated (>10 lines) shell scripts.
Python Bindings - ghapi¶
ghapi provides 100% always-updated coverage of the entire GitHub REST API by automatically converting the OpenAPI spec to a Pythonic API. ghapi is always up to date with the latest changes to GitHub APIs.
Last time I tried, there seems to be issues in this Python library.
github-rest-api¶
github-rest-api is a simpler Python wrapper over GitHub REST APIs with a focus on making GitHub Actions workflower eaiser using Python scripts.
Raw REST API¶
It is very straightforward to call GitHub REST APIs. GitHub REST APIs Doc provides cURL, JavaScript and GitHub CLI examples. You can use Convert cURL syntax to Python, Node.js, PHP, R or curlconverter to convert cURL commands to Python requests code. Below are some examples of querying and manipulating GitHub repositories using REST APIs.