Nautical
Nautical
Real-time ocean data from NOAA buoys — Python & Go
Nautical is a library for scraping and parsing real-time and historical oceanographic data from NOAA’s National Data Buoy Center. It supports both Python and Go, and was built for research, data logging, and monitoring — but there are many more possibilities to discover.
Installation
Python (requires 3.9+):
pip install nautical
Go (requires 1.18+):
go get github.com/barbacbd/nautical
Quick Start
from nautical.io.buoy import create_buoy
# Fetch live data for a buoy station
buoy = create_buoy("44099")
if buoy and buoy.valid:
# Iterate over all available measurements
for name, value in buoy.data:
print(f"{name}: {value}")
buoy, err := noaa.CreateBuoy("44099")
if err != nil {
log.Fatal(err)
}
fmt.Println(buoy)
Features
Buoy Data
A buoy may contain any of the following measurements:
Data |
Abbreviation |
Units |
|---|---|---|
Wind Speed |
|
Knots |
Gust |
|
Knots |
Wave Height |
|
Feet |
Dominant Wave Period |
|
Seconds |
Average Wave Period |
|
Seconds |
Pressure |
|
PSI |
Pressure Tendency |
|
PSI |
Air Temperature |
|
Fahrenheit |
Water Temperature |
|
Fahrenheit |
Dew Point |
|
Fahrenheit |
Salinity |
|
PSU |
Visibility |
|
Nautical Miles |
Tide |
|
Feet |
Swell Height |
|
Feet |
Swell Wave Period |
|
Seconds |
Wind Wave Height |
|
Feet |
Wind Wave Period |
|
Seconds |
Ocean Temperature |
|
Fahrenheit |
Wind Speed 10m |
|
Knots |
Wind Speed 20m |
|
Knots |
Depth |
|
Feet |
Sources
A source is a group of buoys organized by sponsor or owner. Use sources to discover available buoys by category.
from nautical.io.sources import get_buoy_sources
sources = get_buoy_sources()
for name, source in sources.items():
print(f"{name}: {len(source)} buoys")
Data Caching
Save and reload buoy data locally. NOAA refreshes data roughly every 30 minutes — the cache lets you avoid redundant network calls.
from nautical.cache import dumps, load
# Save current data
dumps(data)
# Load it back later
cached = load()
Documentation
Python API Reference — auto-generated from source
Go API Reference — hosted on pkg.go.dev
Development
make setup # install + activate pre-commit hooks
make test # run Python and Go tests
make lint # pylint
make format # auto-fix formatting (ruff + gofmt)
make docs # build Sphinx API docs locally
make clean # remove build artifacts
Contributing
See CONTRIBUTING.md for guidelines and commit message conventions.
License
Copyright © 2022–2026, Brent Barbachem. Released under the MIT License.
API Reference
- nautical
- nautical package
- Subpackages
- Submodules
- nautical.exceptions module
NauticalErrorDataErrorInvalidBuoyDataErrorInvalidWindDataErrorInvalidLocationDataErrorInvalidTimeDataErrorInvalidSourceDataErrorParsingErrorCDataParsingErrorJSONParsingErrorConversionErrorInvalidUnitsErrorUnitMismatchErrorUnsupportedConversionErrorNetworkErrorBuoyNotFoundErrorNOAAServiceErrorNetworkTimeoutErrorCacheErrorCacheNotFoundErrorCacheWriteErrorCacheReadErrorLocationErrorInvalidCoordinatesErrorOutOfBoundsErrorDistanceCalculationError
- nautical.release module
- Module contents
- nautical package