Corps water management 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(ts_id='Some.Fully.Qualified.Ts.Id',office_id='OFFICE1' , 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}
TimeSeries Profile API Compatibility Warning
Currently, the TimeSeries Profile API may not be fully supported until a new version of cwms-data-access is released with the updated endpoint implementation.
Contributing
Please view the contribution documentation here: [CONTRIBUTING.md]
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cwms_python-0.7.1.tar.gz.
File metadata
- Download URL: cwms_python-0.7.1.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4e3a5c37a40cdcf7c042980191d8fe733a9f0016504198590339ab76573e2df
|
|
| MD5 |
229f8712fffd795aaaaddcf6aec35735
|
|
| BLAKE2b-256 |
27c3a044ad859a51b6f995c1d92fdaac224d30067de070e4ac713b8515c97a2d
|
Provenance
The following attestation bundles were made for cwms_python-0.7.1.tar.gz:
Publisher:
pypi-deploy.yml on HydrologicEngineeringCenter/cwms-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cwms_python-0.7.1.tar.gz -
Subject digest:
a4e3a5c37a40cdcf7c042980191d8fe733a9f0016504198590339ab76573e2df - Sigstore transparency entry: 242229152
- Sigstore integration time:
-
Permalink:
HydrologicEngineeringCenter/cwms-python@b6a3ee96d19afa494d3067cdbc5a0073764fd271 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HydrologicEngineeringCenter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@b6a3ee96d19afa494d3067cdbc5a0073764fd271 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cwms_python-0.7.1-py3-none-any.whl.
File metadata
- Download URL: cwms_python-0.7.1-py3-none-any.whl
- Upload date:
- Size: 57.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6c8d0b4b2725f18f65dd2825181bafaea80d0ca9f28ec0c8d6c55e58d1ac3c3
|
|
| MD5 |
adfb4ad3b78b52e1a64888d77b098428
|
|
| BLAKE2b-256 |
919db921dde4a8cd4bdf71f96fe19b27f695ec3a7363b42bd156bed05cbd2f4c
|
Provenance
The following attestation bundles were made for cwms_python-0.7.1-py3-none-any.whl:
Publisher:
pypi-deploy.yml on HydrologicEngineeringCenter/cwms-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cwms_python-0.7.1-py3-none-any.whl -
Subject digest:
c6c8d0b4b2725f18f65dd2825181bafaea80d0ca9f28ec0c8d6c55e58d1ac3c3 - Sigstore transparency entry: 242229158
- Sigstore integration time:
-
Permalink:
HydrologicEngineeringCenter/cwms-python@b6a3ee96d19afa494d3067cdbc5a0073764fd271 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HydrologicEngineeringCenter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@b6a3ee96d19afa494d3067cdbc5a0073764fd271 -
Trigger Event:
workflow_dispatch
-
Statement type: