Skip to main content

Low level Python and CLI interface to GitHub

Project description

HexaHub: A coward's fork of OctoHub: Low level Python and CLI interface to GitHub (Enterprise)

OctoHub is a Python package that provides a low level interface to the
full GitHub v3 API:

* `Activity`_
* `Gists`_
* `Git Data`_
* `Issues`_
* `Orgs`_
* `Pull Requests`_
* `Repositories`_
* `Users`_
* `Search`_

OctoHub was developed out of a need to have a one-to-one interface to
the GitHub API based on the excellent `online documentation`_, with the
least amount of abstraction.

OctoHub does do its part by parsing raw json responses into Pythonic
attribute dictionaries, as well providing an optional iterative Pager
for handling pagination.

Also included is a command line interface for quick interaction with
GitHub's API.

Speaking of development, it's really easy to leverage the base code to
develop higher level tools, see `contrib`_ for some examples. We also
love pull requests, see our `gitflow`_ for guidelines and walk through.



$ git clone
$ cd hexahub
$ sudo make install


* `python-requests`_
* `python-simplejson`_

GitHub Token

OctoHub can be used anonymously, but is much more useful when authenticated.
You can create a revokable access token under ``Personal API Tokens`` in your
`account settings`_.

Usage examples (API)


>>> from octohub.connection import Connection

>>> conn = Connection(token)
>>> uri = '/repos/turnkeylinux/tracker/issues'
>>> response = conn.send('GET', uri, params={'labels': 'bug'})
>>> for issue in response.parsed:
...: print issue.title

>>> from octohub.connection import Pager
>>> pager = Pager(conn, uri)
>>> for issue in pager:
...: print issue.title

Usage examples (CLI)


# A Personal Access Token from your GitHub account:
# Account Settings > Applications > Personal Access Tokens > Create new token
$ export OCTOHUB_TOKEN=d34db33fd34db33fd34db33fd34db33fd34db33f
$ octohub GET /repos/turnkeylinux/tracker/issues labels=feature

INFO [response]: status: 200 OK
INFO [response]: x-ratelimit-limit: 5000
INFO [response]: x-ratelimit-remaining: 4997
"body": "...
"title": "...

$ cat repo.json
"name": "test",
"description": "My test project",
"homepage": "",
$ octohub POST /user/repos --input=repo.json

INFO [response]: status: 201 Created
INFO [response]: x-ratelimit-limit: 5000
INFO [response]: x-ratelimit-remaining: 4996

For more example usage::

$ octohub --help

.. _Activity:
.. _Gists:
.. _Git Data:
.. _Issues:
.. _Orgs:
.. _Pull Requests:
.. _Repositories:
.. _Users:
.. _Search:
.. _online documentation:
.. _contrib:
.. _gitflow:
.. _python-requests:
.. _python-simplejson:
.. _account settings:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hexahub, version 1.0.9
Filename, size File type Python version Upload date Hashes
Filename, size hexahub-1.0.9-py2-none-any.whl (11.3 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size hexahub-1.0.9.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page