Python bindings for the RGB Notes API


License
MIT
Install
pip install rgbnotes==1.2.2

Documentation

RGB Notes Python Library

The RGB Notes Python library provides convenient access to the RGB Notes API from applications written in the Python language. It includes a pre-defined set of classes for API resources.

Documentation

See the API docs.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install --upgrade rgbnotes

Install from source with:

python setup.py install

Requirements

  • Python 2.6+ or Python 3.3+ (PyPy supported)
  • Requests Module (PyPy supported)

Usage

The library needs to be configured with your account's secret key which is available in your RGB Notes Settings.

For Developers

API v1

import rgbnotes
rgbnotes.client_key = "your client key"
rgbnotes.client_id = "your client id"
# request a client or project token. Refer to the API
# documentation to see the difference in scope
rgbnotes.Token.client()
rgbnotes.Token.project(project_id=2, client_id=7)

API Methods

All methods are encapsulated in it's own class. The method names used on classes are:

CLS.create()
CLS.list()
CLS.retrieve(id)
CLS.modify(id, **data)
CLS.delete(id)

Projects Request

rgbnotes.Project.create(title="New Project")
rgbnotes.Project.list()
rgbnotes.Project.modify(2, title="New Project Title")
rgbnotes.Project.delete(2)

Assets Request

# requires a project Token or project_id parameter
rgbnotes.Asset.list()
rgbnotes.Asset.create(title="New Asset")
rgbnotes.Asset.version(asset_id=422)

Notes Request

# requires a project Token or project_id parameter
rgbnotes.Note.list()

Users Request

rgbnotes.User.create(name="John Doe", email="john@doe.com")
rgbnotes.User.list()

File Request

fp = open("/path/to/file", "rb")
rgbnotes.File.create(file=fp)
rgbnotes.File.list()

Snapshot Request

rgbnotes.Snapshot.retrieve(id)

Account Request

rgbnotes.Account.retrieve()

Webhook Request

rgbnotes.Webhook.modify(url="http://myurl.com/webhook", secret_header_field="", secret_header_value="")
rgbnotes.Webhook.list()
rgbnotes.Webhook.delete(id)