PyCodebase is a client for the Codebase API. It works in Python 2.7. The source code and project lives on GitHub.
You can install from PyPI:
$ pip install pycodebase
First you need a client to connect to Codebase. You can pass a 2-tuple of your API username and key:
import codebase
# Your API username and key, shown on Codebase's profile page.
secrets = ('example/alice', 'abc123def456')
client = codebase.Client(secrets)
An alternative is to create a file with the username and key:
$ cat ~/.codebase.ini
[api]
username = example/alice
key = abc123def456
You can then create the client, telling it the path of your secrets file.
import codebase
client = codebase.Client.with_secrets('~/.codebase.ini')
From there you can get projects in your account and all the ticket and status information related to those projects.