HydroFunctions
A suite of convenience functions for working with hydrology data in an interactive Python session.
https://github.com/mroberge/hydrofunctions
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords
hydrology scientific-visualization water
Keywords from Contributors
earth-science
Last synced: about 10 hours ago
JSON representation
Repository metadata
A suite of convenience functions for working with hydrology data in an interactive Python session.
- Host: GitHub
- URL: https://github.com/mroberge/hydrofunctions
- Owner: mroberge
- License: mit
- Created: 2016-08-12T01:16:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T19:28:04.000Z (almost 2 years ago)
- Last Synced: 2025-12-08T16:23:26.776Z (18 days ago)
- Topics: hydrology, scientific-visualization, water
- Language: Python
- Homepage:
- Size: 6.28 MB
- Stars: 72
- Watchers: 5
- Forks: 28
- Open Issues: 10
- Releases: 9
-
Metadata Files:
- Readme: README.rst
- Contributing: docs/contributing.rst
- License: LICENSE
README.rst
===============================
HydroFunctions
===============================
.. image:: https://img.shields.io/pypi/v/hydrofunctions.svg
:target: https://pypi.python.org/pypi/hydrofunctions
:alt: Visit Hydrofunctions on PyPI
.. image:: https://github.com/mroberge/hydrofunctions/actions/workflows/test.yaml/badge.svg
:target: https://github.com/mroberge/hydrofunctions/actions/workflows/test.yaml
:alt: Unit Testing Status
.. image:: https://codecov.io/gh/mroberge/hydrofunctions/branch/master/graph/badge.svg
:target: https://codecov.io/gh/mroberge/hydrofunctions
:alt: Code Coverage Status
.. image:: https://readthedocs.org/projects/hydrofunctions/badge/?version=latest
:target: https://hydrofunctions.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
:target: https://github.com/mroberge/hydrofunctions/blob/master/LICENSE
:alt: MIT license
A suite of convenience functions for exploring water data in Python.
Features
--------
* Retrieves stream data from the USGS NWIS service
* Select data using multiple site numbers, by state, county codes, or a boundary box
* Preserves NWIS metadata, including NoData values
* Helpful error messages to help you write valid requests
* Extracts data into a Pandas dataframe, json, or dict
* Plot beautiful graphs in Jupyter Notebooks
* hydrographs (or time series of any data)
* flow duration charts
* cycle plots to illustrate annual or diurnal cycles
* Interactive map for finding stream gauge ID numbers
* Plotting and manipulation through Pandas dataframes
* Retrieve USGS rating curves, peak discharges, field notes, and site files for gauging stations
* Retrieve USGS daily, monthly, and annual statistics for gauging stations
* Saves data in compact, easy-to-use parquet files instead of requesting the same dataset repeatedly
* **Massive** `Users Guide`_ **that makes Hydrology AND Data Science easy!**
Still in active development! Let me know what features you want!
Read the `Users Guide`_ for more details.
Basic Usage
-----------
First, import hydrofunctions into your project. If you plan to work with Jupyter
notebooks, then go ahead and enable automatic chart display:
.. code-block:: ipython
In [1]: import hydrofunctions as hf
%matplotlib inline
Create an NWIS data object to hold our request and the data we will retrieve.
We will request the instantaneous values ('iv') for site '01585200' for the
past 55 days:
.. code-block:: ipython
In [2]: herring = hf.NWIS('01585200', 'iv', period='P55D')
Requested data from https://waterservices.usgs.gov/nwis/iv/?format=json%2C1.1&sites=01585200&period=P55D
You can check that the request went smoothly:
.. code-block:: ipython
In [3]: herring.ok
Out [3]: True
Find out what data we received:
.. code-block:: ipython
In [4]: herring
Out [4]: USGS:01585200: WEST BRANCH HERRING RUN AT IDLEWYLDE, MD
00060: <5 * Minutes> Discharge, cubic feet per second
00065: <5 * Minutes> Gage height, feet
Start: 2019-05-25 01:05:00+00:00
End: 2019-07-19 19:05:00+00:00
This tells us the name of our site and gives a list of the parameters that we
have. For each parameter it lists how frequently the data were collected, and
it shows the common name of the parameter and its units.
Create a dataframe using only our discharge data, and list the first five items:
.. code-block:: ipython
In [5]: herring.df('discharge').head()
Out [5]:
*--a table with our data appears--*
+------------------------------+---------------------------+
| datetimeUTC | USGS:01585200:00060:00000 |
+------------------------------+---------------------------+
| 2019-05-25 01:05:00+00:00 | 1.57 |
+------------------------------+---------------------------+
| 2019-05-25 01:10:00+00:00 | 1.57 |
+------------------------------+---------------------------+
| 2019-05-25 01:15:00+00:00 | 1.51 |
+------------------------------+---------------------------+
| 2019-05-25 01:20:00+00:00 | 1.57 |
+------------------------------+---------------------------+
| 2019-05-25 01:25:00+00:00 | 1.57 |
+------------------------------+---------------------------+
If we're using Jupyter Lab, we can plot a graph of the data using built-in methods from Pandas and mathplotlib:
.. code-block:: ipython
In [6]: herring.df('q').plot()
Out [6]:
*--a stream hydrograph appears--*
.. image:: https://raw.githubusercontent.com/mroberge/hydrofunctions/master/_static/HerringHydrograph.png
:alt: a stream hydrograph for Herring Run
Learn more:
* `Users Guide`_
Easy Installation
-----------------
The easiest way to install Hydrofunctions is by typing this from your
command line:
.. code-block:: console
$ pip install hydrofunctions
Hydrofunctions depends upon Pandas and numerous other scientific packages
for Python. `Anaconda `_
is an easy, safe, open-source method for downloading everything and avoiding
conflicts with other versions of Python that might be running on your
computer.
Visit the `Installation Page `_
in the Users Guide to learn how to install
Anaconda, or if you have problems using the Easy Installation method above.
.. _`Users Guide`: https://hydrofunctions.readthedocs.io/en/latest
Owner metadata
- Name: Martin Roberge
- Login: mroberge
- Email:
- Kind: user
- Description:
- Website:
- Location: Towson, MD
- Twitter:
- Company: Towson University
- Icon url: https://avatars.githubusercontent.com/u/6432867?v=4
- Repositories: 18
- Last ynced at: 2024-06-11T15:38:38.643Z
- Profile URL: https://github.com/mroberge
GitHub Events
Total
- Watch event: 5
- Fork event: 1
Last Year
- Watch event: 4
Committers metadata
Last synced: about 23 hours ago
Total Commits: 669
Total Committers: 9
Avg Commits per committer: 74.333
Development Distribution Score (DDS): 0.034
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| mroberge | m****s@g****m | 646 |
| elmerehbi | e****i | 12 |
| Joseph D Hughes | j****s@u****v | 5 |
| mopickel | 5****l | 1 |
| lapidesd | d****s@g****m | 1 |
| Nathan Korinek | n****0@c****u | 1 |
| Karl Tarbet | k****t | 1 |
| James McCreight | j****c@u****u | 1 |
| dgketchum | p****y | 1 |
Committer domains:
- ucar.edu: 1
- colorado.edu: 1
- usgs.gov: 1
Issue and Pull Request metadata
Last synced: about 1 month ago
Total issues: 49
Total pull requests: 75
Average time to close issues: 7 months
Average time to close pull requests: 6 days
Total issue authors: 13
Total pull request authors: 10
Average comments per issue: 2.94
Average comments per pull request: 1.0
Merged pull request: 69
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- mroberge (36)
- cheginit (2)
- DavidLitwin (1)
- yueyin1992 (1)
- nlamkey (1)
- mrranck (1)
- danhamill (1)
- craignwf (1)
- dgketchum (1)
- ajb474 (1)
- nkorinek (1)
- rckwzrd (1)
- lapidesd (1)
Top Pull Request Authors
- mroberge (61)
- jdhughes-usgs (4)
- jmccreight (2)
- ktarbet (2)
- dgketchum (2)
- mopickel (1)
- elmerehbi (1)
- lapidesd (1)
- nkorinek (1)
- thejibin (1)
Top Issue Labels
- enhancement (7)
- docs (2)
- bug (1)
Top Pull Request Labels
Package metadata
- Total packages: 3
-
Total downloads:
- pypi: 584 last-month
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 15 (may contain duplicates)
- Total versions: 25
- Total maintainers: 1
proxy.golang.org: github.com/mroberge/hydrofunctions
- Homepage:
- Documentation: https://pkg.go.dev/github.com/mroberge/hydrofunctions#section-documentation
- Licenses: mit
- Latest release: v0.2.4 (published over 2 years ago)
- Last Synced: 2025-12-23T19:04:03.062Z (2 days ago)
- Versions: 10
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
pypi.org: hydrofunctions
A suite of convenience functions for exploring water data in a Jupyter Notebook
- Homepage: https://github.com/mroberge/hydrofunctions
- Documentation: https://hydrofunctions.readthedocs.io
- Licenses: MIT license
- Latest release: 0.2.4 (published over 2 years ago)
- Last Synced: 2025-12-23T19:04:01.300Z (2 days ago)
- Versions: 13
- Dependent Packages: 0
- Dependent Repositories: 5
- Downloads: 584 Last month
- Docker Downloads: 0
-
Rankings:
- Dependent repos count: 6.742%
- Dependent packages count: 7.31%
- Forks count: 7.814%
- Average: 8.594%
- Stargazers count: 8.808%
- Downloads: 12.297%
- Maintainers (1)
conda-forge.org: hydrofunctions
- Homepage: https://github.com/mroberge/hydrofunctions
- Licenses: MIT
- Latest release: 0.2.1 (published over 4 years ago)
- Last Synced: 2025-12-01T10:03:55.682Z (25 days ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 10
-
Rankings:
- Dependent repos count: 11.016%
- Average: 34.226%
- Forks count: 34.589%
- Stargazers count: 39.76%
- Dependent packages count: 51.54%
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1 composite
Score: 13.000873479816619