noaa_coops

A Python wrapper for the NOAA CO-OPS Tides & Currents Data and Metadata APIs.

https://github.com/gclunies/noaa_coops

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 7 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary

Keywords

coops currents metocean noaa python sensors-data tides water-level weather-api

Keywords from Contributors

particles
Last synced: 6 months ago · JSON representation

Repository

A Python wrapper for the NOAA CO-OPS Tides & Currents Data and Metadata APIs.

Basic Info
  • Host: GitHub
  • Owner: GClunies
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 278 KB
Statistics
  • Stars: 92
  • Watchers: 5
  • Forks: 30
  • Open Issues: 3
  • Releases: 0
Topics
coops currents metocean noaa python sensors-data tides water-level weather-api
Created almost 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

noaa_coops

PyPI PyPI - Python Version

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. ```bash

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:

```python

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

from pprint import pprint from noaacoops import Station, getstationsfrombbox stations = getstationsfrombbox(latcoords=[40.389, 40.9397], loncoords=[-74.4751, -73.7432]) pprint(stations) ['8516945', '8518750', '8519483', '8531680'] stationone = 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.

```python

from pprint import pprint from noaacoops 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.latlon['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.

```python

from noaacoops import Station from pprint import pprint seattle = Station(id="9447130") pprint(seattle.datainventory) {'Air Temperature': {'enddate': '2019-01-02 18:36', 'startdate': '1991-11-09 01:00'}, 'Barometric Pressure': {'enddate': '2019-01-02 18:36', 'startdate': '1991-11-09 00:00'}, 'Preliminary 6-Minute Water Level': {'enddate': '2023-02-05 19:54', 'startdate': '2001-01-01 00:00'}, 'Verified 6-Minute Water Level': {'enddate': '2022-12-31 23:54', 'startdate': '1995-06-01 00:00'}, 'Verified High/Low Water Level': {'enddate': '2022-12-31 23:54', 'startdate': '1977-10-18 02:18'}, 'Verified Hourly Height Water Level': {'enddate': '2022-12-31 23:00', 'startdate': '1899-01-01 00:00'}, 'Verified Monthly Mean Water Level': {'enddate': '2022-12-31 23:54', 'startdate': '1898-12-01 00:00'}, 'Water Temperature': {'enddate': '2019-01-02 18:36', 'startdate': '1991-11-09 00:00'}, 'Wind': {'enddate': '2019-01-02 18:36', 'startdate': '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.

```python

from noaacoops import Station seattle = Station(id="9447130") dfwaterlevels = seattle.getdata( ... begindate="20150101", ... enddate="20150131", ... product="waterlevel", ... datum="MLLW", ... units="metric", ... timezone="gmt") dfwaterlevels.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

```

image

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):

bash 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

  • Name: Greg Clunies
  • Login: GClunies
  • Kind: user

GitHub Events

Total
  • Issues event: 2
  • Watch event: 7
  • Fork event: 3
Last Year
  • Issues event: 2
  • Watch event: 7
  • Fork event: 3

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 151
  • Total Committers: 7
  • Avg Commits per committer: 21.571
  • Development Distribution Score (DDS): 0.106
Past Year
  • Commits: 8
  • Committers: 2
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.375
Top Committers
Name Email 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 (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 24
  • Total pull requests: 43
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 16
  • Total pull request authors: 12
  • Average comments per issue: 1.63
  • Average comments per pull request: 0.72
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • salme146 (5)
  • GClunies (3)
  • wrightky (2)
  • kthyng (2)
  • Russ-Nasrallah (1)
  • dianamJLAB (1)
  • MehdiArmandei (1)
  • sdat2 (1)
  • DanRamage (1)
  • mauroc (1)
  • jbouwh (1)
  • cheginit (1)
  • ArchiHowlader (1)
  • Manish-Singh-Mehra (1)
  • ergpudb (1)
Pull Request Authors
  • GClunies (26)
  • dependabot[bot] (8)
  • kthyng (3)
  • kcpevey (2)
  • CraigHarterMM (1)
  • bkposton (1)
  • alexander0042 (1)
  • srpeiter (1)
  • cheginit (1)
  • jshufro (1)
  • sdat2 (1)
Top Labels
Issue Labels
bug (2) enhancement (1)
Pull Request Labels
dependencies (8)

Packages

  • Total packages: 3
  • Total downloads: unknown
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 11
proxy.golang.org: github.com/gclunies/noaa_coops
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 6 months ago
proxy.golang.org: github.com/GClunies/noaa_coops
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 6 months ago
conda-forge.org: noaa-coops
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 33.2%
Dependent repos count: 34.0%
Stargazers count: 39.1%
Average: 39.4%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

.github/workflows/pre_release.yml actions
  • JRubics/poetry-publish v1.16 composite
  • actions/checkout v3 composite
.github/workflows/pull_request.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • snok/install-poetry v1 composite
.github/workflows/release.yml actions
  • JRubics/poetry-publish v1.16 composite
  • actions/checkout v3 composite
poetry.lock pypi
  • 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
pyproject.toml pypi
  • numpy ^1.24.1
  • pandas ^1.5.3
  • python ^3.8
  • requests ^2.28.2
  • zeep ^4.2.1