cwms-python


Namecwms-python JSON
Version 0.8.0 PyPI version JSON
download
home_pageNone
SummaryCorps water management systems (CWMS) REST API for Data Retrieval of USACE water data
upload_time2025-07-11 17:25:08
maintainerNone
docs_urlNone
authorEric Novotny
requires_python<4.0,>=3.9
licenseLICENSE
keywords usace water data cwms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CWMSpy

CWMS REST API for Data Retrieval

## Requirements.

Python 3.9+

## Installation & Usage

### pip install

```sh
pip install cwms-python
```

Then import the package:

```python
import cwms
```

## Getting Started

```python
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
```

```python
#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]


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cwms-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "USACE, water data, CWMS",
    "author": "Eric Novotny",
    "author_email": "eric.v.novotny@usace.army.mil",
    "download_url": "https://files.pythonhosted.org/packages/03/ac/f2352874a1376a0b6986218d2ff051f8f0f9fb8c5e181acecc5c0a9bc5db/cwms_python-0.8.0.tar.gz",
    "platform": null,
    "description": "# CWMSpy\n\nCWMS REST API for Data Retrieval\n\n## Requirements.\n\nPython 3.9+\n\n## Installation & Usage\n\n### pip install\n\n```sh\npip install cwms-python\n```\n\nThen import the package:\n\n```python\nimport cwms\n```\n\n## Getting Started\n\n```python\nimport cwms\nfrom datetime import datetime, timedelta\n\nend = datetime.now()\nbegin = end - timedelta(days = 10)\ndata = cwms.get_timeseries(ts_id='Some.Fully.Qualified.Ts.Id',office_id='OFFICE1' , begin = begin, end = end)\n\n#a cwms data object will be provided this object containes both the JSON as well\n#as the values converted into a dataframe\n\n#display the dataframe\n\ndf = data.df\nprint(df)\n```\n\n```\n     date-time \tvalue \tquality-code\n0 \t2024-04-23 08:15:00 \t86.57 \t3\n1 \t2024-04-23 08:30:00 \t86.57 \t3\n2 \t2024-04-23 08:45:00 \t86.58 \t3\n3 \t2024-04-23 09:00:00 \t86.58 \t3\n4 \t2024-04-23 09:15:00 \t86.58 \t3\n5 \t2024-04-23 09:30:00 \t86.58 \t3\n6 \t2024-04-23 09:45:00 \t86.59 \t3\n7 \t2024-04-23 10:00:00 \t86.58 \t3\n```\n\n```python\n#display JSON\njson = data.JSON\nprint(json)\n```\n\n```\n{'name': 'Some.Fully.Qualified.Ts.Id',\n 'office-id': 'MVP',\n 'units': 'ft',\n 'values': [['2024-04-23T08:15:00', 86.57, 3],\n  ['2024-04-23T08:30:00', 86.57, 3],\n  ['2024-04-23T08:45:00', 86.57999999999997, 3],\n  ['2024-04-23T09:00:00', 86.57999999999997, 3],\n  ['2024-04-23T09:15:00', 86.57999999999997, 3],\n  ['2024-04-23T09:30:00', 86.57999999999997, 3],\n  ['2024-04-23T09:45:00', 86.59, 3],\n  ['2024-04-23T10:00:00', 86.57999999999997, 3]],\n 'version-date': None}\n```\n\n## TimeSeries Profile API Compatibility Warning\n\nCurrently, the TimeSeries Profile API may not be fully supported\nuntil a new version of cwms-data-access is released with the updated \nendpoint implementation.\n\n## Contributing\n\nPlease view the contribution documentation here: [CONTRIBUTING.md]\n\n",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "Corps water management systems (CWMS) REST API for Data Retrieval of USACE water data",
    "version": "0.8.0",
    "project_urls": {
        "Repository": "https://github.com/HydrologicEngineeringCenter/cwms-python"
    },
    "split_keywords": [
        "usace",
        " water data",
        " cwms"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "edbbedc94e131c3cb387acace7091a252f0e758f8a0812cfd609dbfbe7ade1b3",
                "md5": "5b496b3083a65c2129141383b804078e",
                "sha256": "2ab7f6b6ca54a8f3e8c8a1421eefed008f96cf2b81772bbce82422bf154c173f"
            },
            "downloads": -1,
            "filename": "cwms_python-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5b496b3083a65c2129141383b804078e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 59360,
            "upload_time": "2025-07-11T17:25:07",
            "upload_time_iso_8601": "2025-07-11T17:25:07.088261Z",
            "url": "https://files.pythonhosted.org/packages/ed/bb/edc94e131c3cb387acace7091a252f0e758f8a0812cfd609dbfbe7ade1b3/cwms_python-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "03acf2352874a1376a0b6986218d2ff051f8f0f9fb8c5e181acecc5c0a9bc5db",
                "md5": "30eedf5271ddfc45bd1658c3c9fac40b",
                "sha256": "71da687f35680ddb88bdba0464eb3585d05289f507872fdcd31e85483f26654b"
            },
            "downloads": -1,
            "filename": "cwms_python-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "30eedf5271ddfc45bd1658c3c9fac40b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 35008,
            "upload_time": "2025-07-11T17:25:08",
            "upload_time_iso_8601": "2025-07-11T17:25:08.543043Z",
            "url": "https://files.pythonhosted.org/packages/03/ac/f2352874a1376a0b6986218d2ff051f8f0f9fb8c5e181acecc5c0a9bc5db/cwms_python-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 17:25:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "HydrologicEngineeringCenter",
    "github_project": "cwms-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cwms-python"
}
        
Elapsed time: 1.09622s