Skip to main content

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.8+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/HydrologicEngineeringCenter/cwms-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/HydrologicEngineeringCenter/cwms-python.git)

Then import the package:

from CWMS import CWMS

Getting Started

Please follow the installation procedure and then run the following:

from CWMS import CWMS
from datetime import datetime, timedelta

apiRoot = 'CDA url to connect to'

cwms = CWMS()
cwms.connect(apiRoot)


end = datetime.now()
start = end - timedelta(days = 10)
df cwms.retrieve_ts(p_tsId='Some.Fully.Qualified.Ts.Id',p_start_date = start, p_end_date = end)
ts_df.head()
date-time	value	quality-code
0	2023-12-25 06:00:00	1432.82	0
1	2023-12-28 06:00:00	1432.86	0
2	2023-12-29 06:00:00	1432.92	0
3	2023-12-30 06:00:00	1432.92	0
4	2023-12-31 06:00:00	1432.91	0

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

cwms-python-0.1.0.tar.gz (13.1 kB view hashes)

Uploaded Source

Built Distribution

cwms_python-0.1.0-py3-none-any.whl (18.1 kB view hashes)

Uploaded Python 3

Supported by

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