Corps water managerment systems (CWMS) REST API for Data Retrieval of USACE water data
Project description
CWMSpy
CWMS REST API for Data Retrieval
Requirements.
Python 3.9+
Installation & Usage
pip install
pip install cwms-python
Then import the package:
import cwms
Getting Started
import cwms
from datetime import datetime, timedelta
end = datetime.now()
begin = end - timedelta(days = 10)
data = cwms.get_timeseries(p_tsId='Some.Fully.Qualified.Ts.Id',begin = begin, end = end)
#a cwms data object will be provided this object containes both the JSON as well
#as the values converted into a dataframe
#display the dataframe
df = data.df
print(df)
date-time value quality-code
0 2024-04-23 08:15:00 86.57 3
1 2024-04-23 08:30:00 86.57 3
2 2024-04-23 08:45:00 86.58 3
3 2024-04-23 09:00:00 86.58 3
4 2024-04-23 09:15:00 86.58 3
5 2024-04-23 09:30:00 86.58 3
6 2024-04-23 09:45:00 86.59 3
7 2024-04-23 10:00:00 86.58 3
#display JSON
json = data.JSON
print(json)
{'name': 'Some.Fully.Qualified.Ts.Id',
'office-id': 'MVP',
'units': 'ft',
'values': [['2024-04-23T08:15:00', 86.57, 3],
['2024-04-23T08:30:00', 86.57, 3],
['2024-04-23T08:45:00', 86.57999999999997, 3],
['2024-04-23T09:00:00', 86.57999999999997, 3],
['2024-04-23T09:15:00', 86.57999999999997, 3],
['2024-04-23T09:30:00', 86.57999999999997, 3],
['2024-04-23T09:45:00', 86.59, 3],
['2024-04-23T10:00:00', 86.57999999999997, 3]],
'version-date': None}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cwms_python-0.3.0.tar.gz
(15.3 kB
view hashes)
Built Distribution
Close
Hashes for cwms_python-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 902b40807dec0017240cfb44923a8c5b297b54b249fe75b1b46211e683817ec0 |
|
MD5 | ab72b73411051d348405174f9ee3a2c4 |
|
BLAKE2b-256 | 37a2576a4bf076de150ae743e9905a1b02bd8d3b5c83a45c64a6205bdd768178 |