Client — Renga 0.1.0.dev20170915 documentation

Join us on GitHub

# Client

## Creating a client

There are several ways to instantiate a client used for communication with the Renga platform.

1. The easiest way is by calling the function `from_env()` when running in environment created by Renga platform itself.
2. The client can be created from local configuration file by calling `from_config()`.
3. Lastly, it can also be configured manually by instantiating a `RengaClient` class.

`renga.client.` `from_env`()

  Return a client configured from environment variables.

  `RENGA_ENDPOINT`

    The URL to the Renga platform.

  `RENGA_ACCESS_TOKEN`

    An access token obtained from Renga authentication service.

  Example:

      >>> import renga
      >>> client = renga.from_env()

`renga.cli._client.` `from_config`()

  Create new client for endpoint in the config.

  Use `renga` command-line interface to manage multiple configurations.

## Client reference

class `renga.client.` `RengaClient`

  A client for communicating with a Renga platform.

  Example:

      >>> import renga
      >>> client = renga.RengaClient('http://localhost')

  Create a Renga API client.

  `projects`

    An object for managing projects on the server.

    See the projects documentation for full details.

  `buckets`

    An object for managing buckets on the server.

    See the buckets documentation for full details.

  `contexts`

    An object for managing contexts on the server.

    See the contexts documentation for full details.