GithubHelp home page GithubHelp logo

cwmspy's Introduction

cwmspy

Wrapper around the HEC CWMS api

Visit the documentation for full description.

Installation

pip install git+https://github.com/jetilton/cwmspy.git

You will need to navigate to the package location and create a .env file with the appropriate user, password, host and service name to automatically connect to the CWMS Oracle database. You will also need to have followed the instructions for the python package cx_Oracle.

Usage example

from cwmspy import CWMS 

cwms = CWMS()
cwms.connect()
df = cwms.retrieve_ts(p_cwms_ts_id='Some.Fully.Qualified.Ts.Id', start_time='2019/1/1', end_time='2019/9/1', return_df=True)

df.head()
            date_time  value  quality_code
0 2018-12-31 23:00:00    NaN             5
1 2019-01-01 00:00:00    0.0             0
2 2019-01-01 01:00:00    0.0             0
3 2019-01-01 02:00:00    0.0             0
4 2019-01-01 03:00:00    0.0             0

Visit the documentation for more examples.

Meta

Jeff Tilton โ€“ [email protected]

https://github.com/jetilton/cwmspy

Contributing

  1. Fork it (https://github.com/jetilton/cwmspy/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

cwmspy's People

Contributors

jetilton avatar allisonworks avatar

Stargazers

Charles Graham avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

allisonworks

cwmspy's Issues

Add a retrieve_period_of_record

Currently there is only the ability to get a time window, it would be nice to just be able to pull a period of record (POR) for a given time series.

THis would be done in the _Extra class using the get_min_date/get_max_date, which also need to be implemented.

cwms has inconsistent time inputs

Should figure out way to consistently accept input times. i.e. 01-01-2020 rather than both 01-01-2020 & 01/01/2020

Either accept both inputs or convert one input.

retrieve_ts accepts only 01/01/2020 style

retrieve_time_series and store_by_df accepts only 01-01-2020 style

Store_by_df

Should be a method to store by passing a pandas dataframe

Delte_by_df

should be able to pass a pandas data frame with columns date_time, ts_id, value, that deletes all values in df

store_ts

store_ts should be able to:

  • convert times to UTC before storing
  • accept either string dates formatted "%Y/%m/%d" or datetime objects
  • Assume 0 for all quality codes if p_qualities = None

Current behavior expects times in UTC and only accepts datetime objects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.