Wrapper around the HEC CWMS api
Visit the documentation for full description.
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.
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.
Jeff Tilton – [email protected]
https://github.com/jetilton/cwmspy
- Fork it (https://github.com/jetilton/cwmspy/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request