@@ -35,11 +35,29 @@ U.S. Geological Survey (USGS) hydrology data types available on the Web, as well
3535as data from the Water Quality Portal (WQP) and Network Linked Data Index
3636(NLDI).
3737
38+ ## Installation
39+
40+ Install dataretrieval using pip:
41+
42+ ``` bash
43+ pip install dataretrieval
44+ ```
45+
46+ Or using conda:
47+
48+ ``` bash
49+ conda install -c conda-forge dataretrieval
50+ ```
51+
3852## Usage Examples
3953
4054### Water Data API (Recommended - Modern USGS Data)
4155
42- The ` waterdata ` module provides access to modern USGS Water Data APIs:
56+ The ` waterdata ` module provides access to modern USGS Water Data APIs.
57+
58+ The example below retrieves daily streamflow data for a specific monitoring
59+ location for water year 2025, where a "/" between two dates in the "time"
60+ input argument indicates a desired date range:
4361
4462``` python
4563import dataretrieval.waterdata as waterdata
@@ -48,13 +66,27 @@ import dataretrieval.waterdata as waterdata
4866df, metadata = waterdata.get_daily(
4967 monitoring_location_id = ' USGS-01646500' ,
5068 parameter_code = ' 00060' , # Discharge
51- time = ' 2024-10-01/2024-10-02 '
69+ time = ' 2024-10-01/2025-09-30 '
5270)
5371
5472print (f " Retrieved { len (df)} records " )
5573print (f " Site: { df[' monitoring_location_id' ].iloc[0 ]} " )
5674print (f " Mean discharge: { df[' value' ].mean():.2f } { df[' unit_of_measure' ].iloc[0 ]} " )
5775```
76+ Fetch daily discharge data for multiple sites from a start date to present
77+ using the following code:
78+
79+ ``` python
80+ df, metadata = waterdata.get_daily(
81+ monitoring_location_id = [" USGS-13018750" ," USGS-13013650" ],
82+ parameter_code = ' 00060' ,
83+ time = ' 2024-10-01/..'
84+ )
85+
86+ print (f " Retrieved { len (df)} records " )
87+ ```
88+ The following example downloads location information for all monitoring
89+ locations that are categorized as stream sites in the state of Maryland:
5890
5991``` python
6092# Get monitoring location information
@@ -65,7 +97,11 @@ locations, metadata = waterdata.get_monitoring_locations(
6597
6698print (f " Found { len (locations)} stream monitoring locations in Maryland " )
6799```
68- This new module implements
100+ Visit the
101+ [ API Reference] ( https://doi-usgs.github.io/dataretrieval-python/reference/waterdata.html )
102+ for more information and examples on available services and input parameters.
103+
104+ ** NEW:** This new module implements
69105[ logging] ( https://docs.python.org/3/howto/logging.html#logging-basic-tutorial )
70106in which users can view the URL requests sent to the USGS Water Data APIs
71107and the number of requests they have remaining each hour. These messages can
@@ -160,10 +196,13 @@ print(f"Found {len(flowlines)} upstream tributaries within 50km")
160196
161197### Modern USGS Water Data APIs (Recommended)
162198- ** Daily values** : Daily statistical summaries (mean, min, max)
163- - ** Instantaneous values** : High-frequency continuous data
164199- ** Field measurements** : Discrete measurements from field visits
165200- ** Monitoring locations** : Site information and metadata
166201- ** Time series metadata** : Information about available data parameters
202+ - ** Latest daily values** : Most recent daily statistical summary data
203+ - ** Latest instantaneous values** : Most recent high-frequency continuous data
204+ - ** Samples data** : Discrete USGS water quality data
205+ - ** Instantaneous values (:alarm_clock : COMING SOON)** : High-frequency continuous data
167206
168207### Legacy NWIS Services (Deprecated)
169208- ** Daily values (dv)** : Legacy daily statistical data
@@ -185,20 +224,6 @@ print(f"Found {len(flowlines)} upstream tributaries within 50km")
185224- ** Feature discovery** : Find monitoring sites, dams, and other features
186225- ** Hydrologic connectivity** : Link data across the stream network
187226
188- ## Installation
189-
190- Install dataretrieval using pip:
191-
192- ``` bash
193- pip install dataretrieval
194- ```
195-
196- Or using conda:
197-
198- ``` bash
199- conda install -c conda-forge dataretrieval
200- ```
201-
202227## More Examples
203228
204229Explore additional examples in the
0 commit comments