Skip to main content

A Python package to access and process data from the USGS StreamStats API.

Project description

streamstats_access: Python access to the USGS Streamstats API

StreamStats API Python library

Overview

This library provides users access to functionality of the USGS StreamStats application from within Python. The StreamStats app includes a suite of GIS-based hydrologic tools that are useful for water resources planning/management, engineering, and design purposes.

NOTE: This is a community package and has no affiliation the U.S. Geological Survey, Web Informatics and Mapping team, or StreamStats team. While efforts have been made to mimic Batch Processor functionality and formats, results received from this package may differ from results returned by the StreamStats Batch Processor. The Batch Processor contains additional features and technicalities that may not be represented in this package.

Key Features

  • Watershed Delineation: Use streamStats GIS services to delineate watershed polygons from an outlet point.
  • Basin Characteristics: Retrieve basin characteristics such as drainage area, percent wetlands, slope, mean annual precipitation, etc from a delineated watershed.
  • Flow Statistics: Use basin characteristics to derive USGS flow frequency estimates.
  • A Better Batch Point Tool: Submit large batches of points at once. This library mimics the functionality of the StreamStats batch tool.
    • Avoid the 250 point limit of the USGS Streamstats Batch Tool.
    • The library implements asynchronous requests offering 2x speed compared to the batch tool.
    • Avoid the queue. The library directly queries USGS API endpoints, meaning you don't need to wait in the batch point queue.

Installation

To install this package, use pip:

  1. Pip Installation:
    pip install streamstats-access
    
  2. Anaconda Installation (coming soon!):
    # conda install conda_forge:streamstats_access
    

Example Usage

See samples folder for data and scripts.

import streamstats_access as ssa
import os


IN_PATH = os.path.join(os.path.dirname(__file__), 'vt_test.gpkg')
OUT_PATH = os.path.join(os.path.dirname(__file__), 'out_pts.gpkg')


ssa.process_batch(IN_PATH, OUT_PATH, rcode='VT', unique_field='UID')

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any questions or issues, please direct inquiries to Scott Lawson(Scott.Lawson@uvm.edu).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamstats_access-0.1.9.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

streamstats_access-0.1.9-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page