Skip to main content

Command line script to manipulate time series files.

Project description

https://github.com/timcera/hydrotoolbox/actions/workflows/python-package.yml/badge.svg https://coveralls.io/repos/timcera/hydrotoolbox/badge.png?branch=master Latest release BSD-3 clause license hydrotoolbox downloads

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

  • pandas - on Windows this is part scientific Python distributions like Python(x,y), Anaconda, or Enthought.

  • mando - command line parser

Installation

Should be as easy as running pip install hydrotoolbox at any command line. Not sure on Windows whether this will bring in pandas, but as mentioned above, if you start with scientific Python distribution then you shouldn’t have a problem.

Usage - Command Line

Just run ‘hydrotoolbox –help’ to get a list of subcommands:

usage: hydrotoolbox [-h] [-v] {baseflow_sep,recession,about} ...

positional arguments:
  {baseflow_sep,recession,about}
    baseflow_sep        baseflow_sep subcommand
    recession           Recession coefficient.
    about               Display version number and system information.

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

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.

Usage - API

You can use all of the command line subcommands as functions. The function signature is identical to the command line subcommands. The return is always 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='broughton', input_ts='tests/test_fill_01.csv')

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-1.1.0.tar.gz (203.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: hydrotoolbox-1.1.0.tar.gz
  • Upload date:
  • Size: 203.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11

File hashes

Hashes for hydrotoolbox-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a14d39cdd21475ccf9c144643bec1e9f184459e2ced8540552c2c99343e1b0e5
MD5 08690a94f07ebe3659e18a4f2b88ccf3
BLAKE2b-256 803bf0c7a4e5b574e35c2b9526d437101d65fe08b3c3c72592dbd1c13e81cd3d

See more details on using hashes here.

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