Skip to main content

Python bindings for the RGB Notes API

Project description

# RGB Notes Python Library

[![CircleCI](https://circleci.com/gh/rgbnotes/rgb-api-python.svg?style=svg)](https://circleci.com/gh/rgbnotes/rgb-api-python)

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](https://rgbnotes.com/help?section=api).

## 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:

``` {.sourceCode .bash}
pip install --upgrade rgbnotes
```

Install from source with:

``` {.sourceCode .bash}
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](https://rgbnotes.com/login.php?r=/settings.php).



# For Developers

## API v1

``` {.sourceCode .python}
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:

``` {.sourceCode .python}
CLS.create()
CLS.list()
CLS.retrieve(id)
CLS.modify(id, **data)
CLS.delete(id)
```

## Projects Request

``` {.sourceCode .python}
rgbnotes.Project.create(title="New Project")
rgbnotes.Project.list()
rgbnotes.Project.modify(2, title="New Project Title")
rgbnotes.Project.delete(2)
```


## Assets Request

``` {.sourceCode .python}
# 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

``` {.sourceCode .python}
# requires a project Token or project_id parameter
rgbnotes.Note.list()
```


## Users Request

``` {.sourceCode .python}
rgbnotes.User.create(name="John Doe", email="john@doe.com")
rgbnotes.User.list()
```

## File Request

``` {.sourceCode .python}
fp = open("/path/to/file", "rb")
rgbnotes.File.create(file=fp)
rgbnotes.File.list()
```

## Snapshot Request

``` {.sourceCode .python}
rgbnotes.Snapshot.retrieve(id)
```


## Account Request

``` {.sourceCode .python}
rgbnotes.Account.retrieve()
```

## Alias Request

``` {.sourceCode .python}
rgbnotes.Alias.list()
rgbnotes.Alias.create(entity_type='projects',
entity_id=4,
alias=123)
rgbnotes.Alias.modify(id, alias_id)
rgbnotes.Alias.delete(id)
```


## Webhook Request

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


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 rgbnotes, version 1.2.11
Filename, size File type Python version Upload date Hashes
Filename, size rgbnotes-1.2.11-py2-none-any.whl (13.7 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size rgbnotes-1.2.11.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page