hievpy

HIEvPy is a python wrapper around the API interface of the HIEv, a data capture application used by the Hawkesbury Institute for the Environment at Western Sydney University.

View the Project on GitHub gdevine/hievpy

Overview

The HIEv data capture system, hosted at the Hawkesbury Institute for the Environment (HIE) at Western Sydney University, is an application allowing both automated (e.g via sensor-based networks) and manual upload of data into a secure and centralised data server. Registered users have the ability to explore and download hosted data for further scientific analysis and exploration. At its core the HIEv is designed to facilitate and encourage the sharing of, reuse of, and collaboration around data, thus maximising scientific advancement. The HIEvPy library facilitates interaction with the HIEv application using the Python programming language.

HIEv Use

To use HIEvPY you must have an active account (and subsequently a HIEv API token) on the HIEv application. To discuss registration please contact HIE’s data manager, Gerry Devine

Prerequisites

Installation

HIEvPy can be installed via pip:

$ pip install hievpy

Once HIEvPy has been installed, you can import it into a python console or script using:

import hievpy as hp

(using the optional as hp as a shortcut)

HIEv API token

The majority of HIEvPy functions will require passing in your HIEv API key/token for authentication purposes. It is important that you keep your API token outside of your actual code (particularly if you intend on sharing code). Instead, either:

api_token = os.environ['HIEV_API_KEY']

or

hiev_api_token = 'MY_API_KEY'

and then call it in your code with someting like:

import credentials as c
api_token = c.hiev_api_token 

If choosing the latter, ensure that you do not share this credentials file directly with others.

Your HIEv API key/token can be found by logging into the HIEv website and clicking on “settings” in the top right and clicking on your account name.

HIEv Base URL

Whilst the HIEvPy library was originally written for the HIEv application hosted at HIE, additional instances of the HIEv are now in place at different locations, each with their own web url. It is therefore required to pass the ‘base url’ of the HIEv that you are working with to each of the different HIEvPy functions, e.g.:

# Set the base URL of the HIEv instance being called against
base_url = 'https://hiev.westernsydney.edu.au/'

HIEvPy Functions

Generic functions
TOA5 functions