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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file openagua-client-0.2.3.tar.gz.

File metadata

  • Download URL: openagua-client-0.2.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for openagua-client-0.2.3.tar.gz
Algorithm Hash digest
SHA256 f01dfa93343bf081dc4cdaa7c6ba8e83f78663678bd1d2ec3866a8c3f7156e81
MD5 4b8b5c1ea88c67dd9a67c19e22d877ea
BLAKE2b-256 8d5e49489330a246d6fc04427a6ed85fba452c6f1cc5304c9bd8d785d67af948

See more details on using hashes here.

File details

Details for the file openagua_client-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for openagua_client-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 333a27d2ecf7a028ee5d40371b68a68245ee02c0408735d4d902f38eefe51c1e
MD5 4883e3eeb687f573ef60a665bdaa89c7
BLAKE2b-256 16ebb0ebddda9e5ab888c7cac302f09f4d9564177294c7dbcd579f24219166ca

See more details on using hashes here.

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