Checking for non-preferred file/folder path names (may take a long time depending on the number of files/folders) ...

Hydroinformatics Instruction Module Example Code: Programmatic Data Access with USGS Data Retrieval

Owners: This resource does not have an owner who is an active HydroShare user. Contact CUAHSI ( for information on this resource.
Type: Resource
Storage: The size of this resource is 34.5 KB
Created: Jan 28, 2022 at 5:41 p.m.
Last updated: Mar 03, 2022 at 8:35 p.m.
Citation: See how to cite this resource
Sharing Status: Public
Views: 736
Downloads: 91
+1 Votes: Be the first one to 
Comments: No comments (yet)


This resource contains Jupyter Notebooks with examples for accessing USGS NWIS data via web services and performing subsequent analysis related to drought with particular focus on sites in Utah and the southwestern United States (could be modified to any USGS sites). The code uses the Python DataRetrieval package. The resource is part of set of materials for hydroinformatics and water data science instruction. Complete learning module materials are found in HydroLearn: Jones, A.S., Horsburgh, J.S., Bastidas Pacheco, C.J. (2022). Hydroinformatics and Water Data Science. HydroLearn.

This resources consists of 6 example notebooks:
1. Example 1: Import and plot daily flow data
2. Example 2: Import and plot instantaneous flow data for multiple sites
3. Example 3: Perform analyses with USGS annual statistics data
4. Example 4: Retrieve data and find daily flow percentiles
3. Example 5: Further examination of drought year flows
6. Coding challenge: Assess drought severity

Subject Keywords


This resource is part of a HydroLearn module for Hydroinformatics and Water Data Science.

Instructions for running code in the CUAHSI JupyterHub:

  1. Click on "Open with" at the top right
  2. Select CUAHSI JupyterHub and agree to terms of use
  3. Select Python as the Server Option
  4. Once JupyterHub opens, click to open the *.ipynb file for the example of interest
  5. Use the Jupyter tools and run code in each cell to retrieve data, generate plots, etc.
  6. Once the CUAHSI JupyterHub is launched, additional files associated with the resources may be opened directly (File -> Open)

Related Resources

This resource belongs to the following collections:
Title Owners Sharing Status My Permission
Hydroinformatics Instruction Modules Example Code Amber Jones  Public &  Shareable Open Access


Funding Agencies

This resource was created using funding from the following sources:
Agency Name Award Title Award Number
National Science Foundation Collaborative Research: Elements: Advancing Data Science and Analytics for Water (DSAW) 1931297

How to Cite

Jones, A. S., J. S. Horsburgh (2022). Hydroinformatics Instruction Module Example Code: Programmatic Data Access with USGS Data Retrieval, HydroShare,

This resource is shared under the Creative Commons Attribution CC BY.


There are currently no comments

New Comment