ricloud-py client implementation

Updated

The ricloud-py client is a straightforward implementation of the ricloud v3 API interface. It also includes some sample implementations of common use-cases, and some basic implementations of data retrieval from 3rd party storage buckets (AWS S3 and Google Cloud Storage).

Installation

The simplest way to get the client is to install it from PyPi.

pip install ricloud==3.0.0rc0

You can also get the code from the GitHub repo.

Configuration

An key_token is required to authenticate against the API. If you are an existing customer, contact enterprise support to get a trial key for the ricloud v3 API.

ricloud-py can be configured in two ways:

  • Via the token attribute on an imported ricloud module.
import ricloud

ricloud.token = '<your key_token>'
  • Create a .ricloud.ini file in your home directory with the following content.
[api]
token = <you key_token>

See the .ricloud.ini file reference for more details.

Usage

The client exposes a class for each API resource and a set of methods to interact with them.

>>> import ricloud

>>> org = ricloud.Organisation.retrieve()

>>> print(org.name)
My Organisation

>>> org.update(name='Changed Organisation')

>>> print(org.name)
Changed Organisation

 Sample implementations

The client includes sample implementations for a number of common interactions.

These can be accessed through the samples command

iCloud

The iCloud sample implementation offers a quick way to retrieve data from an iCloud account through the command line.

.ricloud.ini file reference

Section: api

token

The token used to authenticate against the API's endpoints.

url

The base url for the API. Default: https://ricloud-api.reincubate.com.

max_retries

How many times to retry a request if it fails due to a server or connection error. Default: 3

Section: logging

log_level

Section: samples

output_directory

The default output directory for any results downloaded as part of a sample script. If the directory path is relative it will be created relative to the current working directory.

user_identifier

The client will create a User resource when executing sample scripts. The default value for this user's identifier is ricloud-py, but can be easily customised via this option.

This can be useful to distinguish usage between different developers within the same organisation, for example.

[api]
token = <your key_token>
url = https://ricloud-api.reincubate.com
max_retries = 1

[logging]
log_directory = logs
log_level = WARNING

[samples]
output_directory = output
user_identifier = ricloud-py

How can we help?

Our support team are here to help!

Our office hours are Monday to Friday, 9 AM to 5 PM GMT. The time is currently 6:06 AM GMT.

We aim to reply to all messages within one working day.

Go to support section › Contact the enterprise team ›
Our awesome support team

© 2008 - 2019 Reincubate Ltd. All rights reserved. Registered in England and Wales #5189175, VAT GB151788978. Reincubate® is a registered trademark. Privacy & terms. We recommend 2FA. Built with in London.