Skip to main content

A very thin wrapper around the OpenAgua web API

Project description

openagua-client

A very thin wrapper around the OpenAgua web API.

Usage

To use this, you need an API key from OpenAgua. Once you have that, you can supply it from an environment variable called OA_SECRET_KEY or directly as an argument to the client.

Here are two examples demonstrating each approach.

Example 1

In this example, the API key is in the environment variable OA_SECRET_KEY. Note that this may be loaded dynamically using, for example, dot_env

from openagua_client import Client as OA
oa = OA()
network = oa.get_network(77)

Example 2

The key is supplied directly. Note that it is best practice to never hard code secrets. Therefore, that is not done in this example, though technically it could be done. Using environment variables for keys is best practice.

import os
from openagua_client import Client as OA
oa_api_key = os.environ['MY_OPENAGUA_API_KEY']
oa = OA(api_key=oa_api_key)
network = oa.get_network(77)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openagua-client-0.2.3.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

openagua_client-0.2.3-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page