noaa_coops
A Python wrapper for the NOAA CO-OPS Tides & Currents Data and Metadata APIs.
https://github.com/gclunies/noaa_coops
Category: Hydrosphere
Sub Category: Ocean and Hydrology Data Access
Keywords
coops currents metocean noaa python sensors-data tides water-level weather-api
Keywords from Contributors
numerical-modeling particle
Last synced: about 13 hours ago
JSON representation
Repository metadata
A Python wrapper for the NOAA CO-OPS Tides & Currents Data and Metadata APIs.
- Host: GitHub
- URL: https://github.com/gclunies/noaa_coops
- Owner: GClunies
- License: apache-2.0
- Created: 2019-04-06T16:19:40.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-03T14:24:54.000Z (9 months ago)
- Last Synced: 2025-04-20T07:52:17.145Z (7 days ago)
- Topics: coops, currents, metocean, noaa, python, sensors-data, tides, water-level, weather-api
- Language: Python
- Homepage:
- Size: 278 KB
- Stars: 88
- Watchers: 5
- Forks: 28
- Open Issues: 0
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
noaa_coops
A Python wrapper for the NOAA CO-OPS Tides & Currents Data
and Metadata APIs.
Installation
This package is distributed via PyPi and can be installed using , pip
, poetry
, etc.
# Install with pip
❯ pip install noaa_coops
# Install with poetry
❯ poetry add noaa_coops
Getting Started
Stations
Data is accessed via Station
class objects. Each station is uniquely identified by an id
. To initialize a Station
object, run:
>>> from noaa_coops import Station
>>> seattle = Station(id="9447130") # Create Station object for Seattle (ID = 9447130)
Stations and their IDs can be found using the Tides & Currents mapping interface. Alternatively, you can search for stations in a bounding box using the get_stations_from_bbox
function, which will return a list of stations found in the box (if any).
>>> from pprint import pprint
>>> from noaa_coops import Station, get_stations_from_bbox
>>> stations = get_stations_from_bbox(lat_coords=[40.389, 40.9397], lon_coords=[-74.4751, -73.7432])
>>> pprint(stations)
['8516945', '8518750', '8519483', '8531680']
>>> station_one = Station(id="8516945")
>>> pprint(station_one.name)
'Kings Point'
Metadata
Station metadata is stored in the .metadata
attribute of a Station
object. Additionally, the keys of the metadata attribute dictionary are also assigned as attributes of the station object itself.
>>> from pprint import pprint
>>> from noaa_coops import Station
>>> seattle = Station(id="9447130")
>>> pprint(list(seattle.metadata.items())[:5]) # Print first 3 items in metadata
[('tidal', True), ('greatlakes', False), ('shefcode', 'EBSW1')] # Metadata dictionary can be very long
>>> pprint(seattle.lat_lon['lat']) # Print latitude
47.601944
>>> pprint(seattle.lat_lon['lon']) # Print longitude
-122.339167
Data Inventory
A description of a Station's data products and available dates can be accessed via the .data_inventory
attribute of a Station
object.
>>> from noaa_coops import Station
>>> from pprint import pprint
>>> seattle = Station(id="9447130")
>>> pprint(seattle.data_inventory)
{'Air Temperature': {'end_date': '2019-01-02 18:36',
'start_date': '1991-11-09 01:00'},
'Barometric Pressure': {'end_date': '2019-01-02 18:36',
'start_date': '1991-11-09 00:00'},
'Preliminary 6-Minute Water Level': {'end_date': '2023-02-05 19:54',
'start_date': '2001-01-01 00:00'},
'Verified 6-Minute Water Level': {'end_date': '2022-12-31 23:54',
'start_date': '1995-06-01 00:00'},
'Verified High/Low Water Level': {'end_date': '2022-12-31 23:54',
'start_date': '1977-10-18 02:18'},
'Verified Hourly Height Water Level': {'end_date': '2022-12-31 23:00',
'start_date': '1899-01-01 00:00'},
'Verified Monthly Mean Water Level': {'end_date': '2022-12-31 23:54',
'start_date': '1898-12-01 00:00'},
'Water Temperature': {'end_date': '2019-01-02 18:36',
'start_date': '1991-11-09 00:00'},
'Wind': {'end_date': '2019-01-02 18:36', 'start_date': '1991-11-09 00:00'}}
Data Retrieval
Available data products can be found in NOAA CO-OPS Data API docs.
Station data can be fetched using the .get_data
method on a Station
object. Data is returned as a Pandas DataFrame for ease of use and analysis. DataFrame columns are named according to the NOAA CO-OPS API docs, with the t
column (timestamp) set as the DataFrame index.
The example below fetches water level data from the Seattle station (id=9447130) for a 1 month period. The corresponding web output is shown below the code as a reference.
>>> from noaa_coops import Station
>>> seattle = Station(id="9447130")
>>> df_water_levels = seattle.get_data(
... begin_date="20150101",
... end_date="20150131",
... product="water_level",
... datum="MLLW",
... units="metric",
... time_zone="gmt")
>>> df_water_levels.head()
v s f q
t
2015-01-01 00:00:00 1.799 0.023 0,0,0,0 v
2015-01-01 00:06:00 1.718 0.018 0,0,0,0 v
2015-01-01 00:12:00 1.639 0.013 0,0,0,0 v
2015-01-01 00:18:00 1.557 0.012 0,0,0,0 v
2015-01-01 00:24:00 1.473 0.014 0,0,0,0 v
Development
Requirements
This package and its dependencies are managed using poetry. To install the development environment for noaa_coops
, first install poetry, then run (inside the repo):
poetry install
TODO
Click here for a list of existing issues and to submit a new one.
Contribution
Contributions are welcome, feel free to submit a pull request.
Owner metadata
- Name: Greg Clunies
- Login: GClunies
- Email:
- Kind: user
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/28986302?u=7e43ff55f595e7973e3e099feb68d5bb25fc0ebd&v=4
- Repositories: 17
- Last ynced at: 2024-06-11T15:56:29.552Z
- Profile URL: https://github.com/GClunies
GitHub Events
Total
- Watch event: 4
Last Year
- Watch event: 4
Committers metadata
Last synced: 7 days ago
Total Commits: 151
Total Committers: 7
Avg Commits per committer: 21.571
Development Distribution Score (DDS): 0.106
Commits in past year: 8
Committers in past year: 2
Avg Commits per committer in past year: 4.0
Development Distribution Score (DDS) in past year: 0.375
Name | Commits | |
---|---|---|
Greg Clunies | g****s@g****m | 135 |
Kim Pevey | k****y@g****m | 7 |
Kristen Thyng | k****g@g****m | 4 |
taataam | t****i@g****m | 2 |
Craig Harter | c****r@m****m | 1 |
Jacob Shufro | j****b@s****o | 1 |
wrightky | k****t@u****u | 1 |
Committer domains:
- utexas.edu: 1
- shuf.ro: 1
- mottmac.com: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 24
Total pull requests: 44
Average time to close issues: 3 months
Average time to close pull requests: about 1 month
Total issue authors: 15
Total pull request authors: 12
Average comments per issue: 1.63
Average comments per pull request: 0.7
Merged pull request: 32
Bot issues: 0
Bot pull requests: 4
Past year issues: 4
Past year pull requests: 6
Past year average time to close issues: 20 days
Past year average time to close pull requests: 18 days
Past year issue authors: 2
Past year pull request authors: 3
Past year average comments per issue: 1.0
Past year average comments per pull request: 1.5
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 2
Top Issue Authors
- salme146 (5)
- GClunies (3)
- Manish-Singh-Mehra (2)
- wrightky (2)
- kthyng (2)
- lassiterdc (1)
- ergpudb (1)
- ArchiHowlader (1)
- cheginit (1)
- jbouwh (1)
- mauroc (1)
- DanRamage (1)
- sdat2 (1)
- MehdiArmandei (1)
- Russ-Nasrallah (1)
Top Pull Request Authors
- GClunies (26)
- kthyng (4)
- dependabot[bot] (4)
- kcpevey (2)
- srpeiter (1)
- CraigHarterMM (1)
- bkposton (1)
- wrightky (1)
- alexander0042 (1)
- cheginit (1)
- jshufro (1)
- sdat2 (1)
Top Issue Labels
- bug (2)
- enhancement (1)
Top Pull Request Labels
- dependencies (4)
Package metadata
- Total packages: 4
-
Total downloads:
- pypi: 5,859 last-month
- Total docker downloads: 757,189,432
- Total dependent packages: 4 (may contain duplicates)
- Total dependent repositories: 546 (may contain duplicates)
- Total versions: 26
- Total maintainers: 1
pypi.org: noaa-coops
Python wrapper for NOAA Tides & Currents Data and Metadata.
- Homepage:
- Documentation: https://noaa-coops.readthedocs.io/
- Licenses: Apache-2.0
- Latest release: 0.4.0 (published 9 months ago)
- Last Synced: 2025-04-25T13:03:53.978Z (1 day ago)
- Versions: 15
- Dependent Packages: 4
- Dependent Repositories: 546
- Downloads: 5,859 Last month
- Docker Downloads: 757,189,432
-
Rankings:
- Docker downloads count: 0.195%
- Dependent repos count: 0.617%
- Dependent packages count: 3.242%
- Average: 4.168%
- Downloads: 4.712%
- Forks count: 7.699%
- Stargazers count: 8.54%
- Maintainers (1)
proxy.golang.org: github.com/GClunies/noaa_coops
- Homepage:
- Documentation: https://pkg.go.dev/github.com/GClunies/noaa_coops#section-documentation
- Licenses:
- Latest release: v0.2.1 (published about 2 years ago)
- Last Synced: 2025-04-25T13:03:57.893Z (1 day ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.999%
- Average: 8.173%
- Dependent repos count: 9.346%
proxy.golang.org: github.com/gclunies/noaa_coops
- Homepage:
- Documentation: https://pkg.go.dev/github.com/gclunies/noaa_coops#section-documentation
- Licenses:
- Latest release: v0.2.1 (published about 2 years ago)
- Last Synced: 2025-04-25T13:03:57.979Z (1 day ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.999%
- Average: 8.173%
- Dependent repos count: 9.346%
conda-forge.org: noaa-coops
- Homepage: https://github.com/GClunies/noaa_coops
- Licenses: GPL-3.0-or-later
- Latest release: 0.1.9 (published over 2 years ago)
- Last Synced: 2025-04-25T13:04:01.221Z (1 day ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 33.247%
- Dependent repos count: 34.025%
- Stargazers count: 39.052%
- Average: 39.375%
- Dependent packages count: 51.175%
Dependencies
- JRubics/poetry-publish v1.16 composite
- actions/checkout v3 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- snok/install-poetry v1 composite
- JRubics/poetry-publish v1.16 composite
- actions/checkout v3 composite
- arrow 1.2.3 develop
- autoflake 2.0.1 develop
- binaryornot 0.4.4 develop
- black 23.1.0 develop
- boolean-py 4.0 develop
- cachetools 5.3.0 develop
- chardet 5.1.0 develop
- click 8.1.3 develop
- colorama 0.4.6 develop
- darglint 1.8.1 develop
- distlib 0.3.6 develop
- exceptiongroup 1.1.0 develop
- filelock 3.9.0 develop
- flake8 6.0.0 develop
- flake8-docstrings 1.7.0 develop
- iniconfig 2.0.0 develop
- isort 5.12.0 develop
- jinja2 3.1.2 develop
- jinja2-time 0.2.0 develop
- license-expression 30.1.0 develop
- make 0.1.6.post2 develop
- markupsafe 2.1.2 develop
- mccabe 0.7.0 develop
- mypy-extensions 1.0.0 develop
- packaging 23.0 develop
- pathspec 0.11.0 develop
- pluggy 1.0.0 develop
- pycodestyle 2.10.0 develop
- pydocstyle 6.3.0 develop
- pyflakes 3.0.1 develop
- pyproject-api 1.5.0 develop
- pytest 7.2.1 develop
- python-debian 0.1.49 develop
- reuse 1.1.1 develop
- setuptools 67.1.0 develop
- snowballstemmer 2.2.0 develop
- toml 0.10.2 develop
- tomli 2.0.1 develop
- tox 4.4.4 develop
- typing-extensions 4.4.0 develop
- virtualenv 20.17.1 develop
- attrs 22.2.0
- certifi 2022.12.7
- charset-normalizer 3.0.1
- idna 3.4
- isodate 0.6.1
- lxml 4.9.2
- numpy 1.24.1
- pandas 1.5.3
- platformdirs 2.6.2
- python-dateutil 2.8.2
- pytz 2022.7.1
- requests 2.28.2
- requests-file 1.5.1
- requests-toolbelt 0.10.1
- six 1.16.0
- urllib3 1.26.14
- zeep 4.2.1
- numpy ^1.24.1
- pandas ^1.5.3
- python ^3.8
- requests ^2.28.2
- zeep ^4.2.1
Score: 26.868379530094604