Skip to content

Latest commit

 

History

76 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hydrograph-py

Build and query datasets for publication on Hydrograph.

Supports:

  • Creating and updating indexed datasets (index.json plus tagged tables, time series and coverages), locally or for publication
  • Read-only access to remotely hosted indexed datasets
  • Read-only access to Hydrograph server-side datasets via the REST API

Installation

Install directly from GitHub with pip:

pip install https://github.com/flowmatters/hydrograph-py/archive/refs/heads/master.zip

To upgrade an existing installation, add --upgrade:

pip install --upgrade https://github.com/flowmatters/hydrograph-py/archive/refs/heads/master.zip

Optional dependencies

Core dependencies (numpy, pandas, requests) are installed automatically. For spatial data (coverages / GeoDataFrames), also install the optional dependencies:

pip install geopandas shapely

Writing coverages with reduced coordinate precision additionally requires the ogr2ogr command line tool (GDAL).

Development install

git clone https://github.com/flowmatters/hydrograph-py.git
cd hydrograph-py
pip install -e '.[optional]'
pytest

Quick start

import hydrograph as hg

# Create a local dataset
ds = hg.open_dataset('path/to/dataset', 'rw')
ds.add_timeseries(series, location='Hamilton', variable='Rain')

# Query it by tags
rain = ds.get_timeseries(location='Hamilton', variable='Rain')

# Open a remote dataset (static index.json or server-side REST API)
remote = hg.open_remote('https://staging.hydrograph.io/api/datasets/owner/dataset-name')
remote.tags()
remote.tag_values('variable')
tables = remote.get_tables(variable='soil-moisture')

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages