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.
To search for records within the HIEv, you can use the hievpy search function:
import hievpy as hp
hp.search(api_token, base_url, search_params)
where
The following search parameters may be used: (see this link for further information )
It is highly recommended that you supply at least one search query to your search to limit returning the full database in one call
You can download a Jupyter notebook version of this example from the /examples folder on the github project page.
As an example, to search for all records matching the filename ‘DRL_AUTO_450LO_SOIL_R’ between 2nd January 2017 and 1st Januaruy 2018, and then print the resulting filenames to screen:
import hievpy as hp
import credentials as c
api_token = c.hiev_api_key
base_url = 'https://hiev.westernsydney.edu.au/'
search_params = {"filename": "DRL_AUTO_450LO_SOIL_R",
"from_date": "2017-01-02",
"to_date": "2018-01-01"}
records = hp.search(api_token, base_url, search_params)
for record in records: print(record['filename'])
DRL_AUTO_450LO_SOIL_R_20171130.dat
DRL_AUTO_450LO_SOIL_R_20170131.dat
DRL_AUTO_450LO_SOIL_R_20170731.dat
DRL_AUTO_450LO_SOIL_R_20170430.dat
DRL_AUTO_450LO_SOIL_R_20171031.dat
DRL_AUTO_450LO_SOIL_R_20170331.dat
DRL_AUTO_450LO_SOIL_R_20170228.dat
DRL_AUTO_450LO_SOIL_R_20170630.dat
DRL_AUTO_450LO_SOIL_R_20180131.dat
DRL_AUTO_450LO_SOIL_R_20170531.dat
DRL_AUTO_450LO_SOIL_R_20170930.dat
DRL_AUTO_450LO_SOIL_R_20170831.dat
DRL_AUTO_450LO_SOIL_R_20171231.dat `