Skip to main content

Command line script and Python library for analysis of flow time-series.

Project description

Tests Test Coverage Latest release BSD-3 clause license PyPI - Python Version

hydrotoolbox - Quick Guide

The hydrotoolbox is a Python script for hydrologic calculations and analysis or by function calls within Python. Uses pandas (http://pandas.pydata.org/) or numpy (http://numpy.scipy.org) for any heavy lifting.

Requirements

  • python 3.10 or higher

Installation

pip

pip install hydrotoolbox

conda

conda install -c conda-forge hydrotoolbox

Usage - API

All functions return a PANDAS DataFrame. Input can be a CSV or TAB separated file, or a PANDAS DataFrame and is supplied to the function via the ‘input_ts’ keyword.

Simply import hydrotoolbox:

from hydrotoolbox import hydrotoolbox

# Then you could call the functions
ntsd = hydrotoolbox.baseflow_sep(method='boughton', input_ts='tests/test_fill_01.csv')

Usage - Command Line

All functions are available from the command line. The command line interface is a wrapper around the functions in the hydrotoolbox module. The command line arguments match one-to-one with the function arguments.

To get help for the command line interface, run:

hydrotoolbox --help

Which gives you the following output:

usage: hydrotoolbox [-h] [-v]
                    {baseflow_sep, recession, flow_duration, storm_events,
                    indices, exceedance_time, about} ...

positional arguments:
  {baseflow_sep,recession,flow_duration,storm_events,indices,exceedance_time,about}
    baseflow_sep        baseflow_sep subcommand
    recession           Recession coefficient.
    flow_duration       Flow duration.
    storm_events        Storm events.
    indices             Calculate hydrologic indices.
    exceedance_time     Calculate the time that a time series exceeds (or is
                        below) a threshold.
    about               Display version number and system information.

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

To get help for a specific subcommand, run:

hydrotoolbox <subcommand> --help

The default for all of the subcommands is to accept data from stdin (typically a pipe). If a subcommand accepts an input file for an argument, you can use “–input_ts=input_file_name.csv”, or to explicitly specify from stdin (the default) “–input_ts=’-‘”.

For the subcommands that output data it is printed to the screen and you can then redirect to a file.

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

hydrotoolbox-2.3.2.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hydrotoolbox-2.3.2-py3-none-any.whl (263.5 kB view details)

Uploaded Python 3

File details

Details for the file hydrotoolbox-2.3.2.tar.gz.

File metadata

  • Download URL: hydrotoolbox-2.3.2.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hydrotoolbox-2.3.2.tar.gz
Algorithm Hash digest
SHA256 7d4a8cd8ae6c959e889d30d5984dcfb4982f3d0ff685513b9f16d45705d6e45a
MD5 5d543091d0c72436211acad6dc487d3f
BLAKE2b-256 024a8d3ced3f99a33f7d72e8de4133d8882632932944d1ed9c67d7200fcf3ddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for hydrotoolbox-2.3.2.tar.gz:

Publisher: pypi-package.yml on timcera/hydrotoolbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hydrotoolbox-2.3.2-py3-none-any.whl.

File metadata

  • Download URL: hydrotoolbox-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 263.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hydrotoolbox-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5f14769bbcc989a32985970acb08a50faa18d5978475617be1896ebd1ed90be
MD5 70249c2dd5cbae25558b54cadc82ae4e
BLAKE2b-256 8a39e55f1c68405327ee52ca91087a9c9d4239cb9dad55090cb3588b4b18965a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hydrotoolbox-2.3.2-py3-none-any.whl:

Publisher: pypi-package.yml on timcera/hydrotoolbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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