Python client for GitHub API
Python client for GitHub API
requires python 3.5+
Note octokit and octokit.py were already taken in the cheese shop
pip install octokitpy
from octokit import Octokit repos = Octokit().repos.get_for_org(org='octokit', type='public') # Make an unauthenticated request for the public repositories of the octokit organization
from octokit import webhook webhook.verify(headers, payload, secret, events=['push'])
octokit.py provides a function to verify webhooks sent to your application.
- dictionary of request headers
- string; payload of request
- string; secret provided to GitHub to sign webhook
- list; events that you want to receive
- boolean; whether or not you want to verify the user agent string of the request
- boolean; whether or not you want to return the app id from the ping event for GitHub applications. This will only return the id if the event is the ping event. Otherwise the return value will be boolean.
Instatiate a client with the authentication scheme and credentials that you want to use.
octokit = Octokit(auth='basic', username='myuser', password='mypassword') octokit.repos.get_for_org(org='octokit', type='private')
response = Octokit(auth='token', token='yak').authorization.get(id=100)
octokit = Octokit(auth='app', app_id='42', private_key=private_key)
octokit = Octokit(auth='installation', app_id='42', private_key=private_key)
For applications provide the application id either from the ping webhook or the application’s page on GitHub.
private_key is a string of your private key provided for the application.
app scheme will use the application id and private key to get a token for the first installation id of the application.
One can instantiate the Octokit with routes=specification where the specification is one of api.github.com, ghe-2.15, etc.
[-] REST (see best practices, integration tests, and errors) [ ] GraphQL client [x] GitHub Apps [ ] OAuth Apps [x] Webhooks
[x] Periodically, check if ``routes.json`` has changed and if so fetch and open a PR for it to be merged [ ] Periodically, check if ``webhook-names.json`` has changed and if so fetch and open a PR for it to be merged
[x] unit tests [ ] integration tests - need fixtures to assert against [ ] coverage uploaded to code climate -- not sure why it is not working
[ ] Raise :code:`OctokitValidationError` for param validation error [ ] Raise :code:`OctokitAuthenticationError` for auth error [ ] Raise :code:`OctokitRateLimitError` for rate limiting errors
[ ] throttling [ ] handles rate limiting [x] pagination
[ ] Auto generated documentation
[x] Deploy wheels [x] Make GitHub releases work
Check box guide
[ ] Incomplete [-] Partially completed [x] Completed
To run the all tests run:
Pull requests are very welcome!
Please see CONTRIBUTING.md for more information.
Package based on cookiecutter-pylibrary
- First release on PyPI.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size octokitpy-0.12.0-py2.py3-none-any.whl (149.0 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View hashes|
|Filename, size octokitpy-0.12.0.tar.gz (158.2 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for octokitpy-0.12.0-py2.py3-none-any.whl