physoce-datasets
A Python package and command line interface aimed at standardizing the access of various oceanographic datasets and calculating derived parameters according to modern best practices.
Why physoce-datasets?
This package provides an opinionated interface which aims to simplify and align access to datasets across providing institutions (NASA, ECMWF, etc.); as such, it is aimed primarily at those looking for streamlined data access. If you are an expert user who wants a lot of control over the details of the download and analysis process, this may not be for you. However, if you want:
- a unified command line and Python interface across datasets
- expert-informed derived variables such as wind stress and eddy kinetic energy
- long time series at a single or a few locations
- the simplest downloading and opening process possible
then this package is designed for you!
Install
uv
uv is the preferred way to manage this package. Please refer to the uv installation instructions. Once uv is installed, you can initialize a virtual environment with uv sync or you can run any commands directly with uv run and uv will handle the venv creation and activation auto-magically.
# add physoce-datasets to your project folder, equivalent to a pip install
uv add physoce-datasets
# you can now run physoce-datasets from your project folder
uv run physoce-datasets --help
Once you've added physoce-datasets to your project, you can import any of the download classes in your scripts:
# note the import uses underscore in place of dash
from physoce_datasets import copernicus_marine, era5, ooi_ea
Alternatively, you can run the command line interface from anywhere using uv tools:
# run physoce-datasets from the command line anywhere!
uvx physoce-datasets --help
pip
Of course, you can also use the classic pip, but you have to handle creating and activating the venv yourself:
python -m venv .venv
source .venv/bin/activate
pip install physoce-datasets
Credentials
Upon usage, this package may prompt for credentials to various data stores. Please refer to their documentation for how to access credentials and how credentials are stored:
Command Line Interface
Run the CLI with uv:
uv run physoce-datasets --help
Note that if you prefer the pip environment management, activate your environment according to the above and replace all uv run commands with python, e.g.:
python physoce-datasets --help
Top level commands are based on providing agency or program:
copernicus-marine: Data from Copernicus Marine Services.era5: Data from ERA5 single levels.nasa: Data from NASA Harmony API. Currently not implemented due to issues with the API, see warning above.ooi-ea: Data from NSF Ocean Observatories Initiative Endurance Array.
Show provider command help, which will include available datasets for downloading:
uv run physoce-datasets ooi-ea --help
The specific dataset to download is specified after the provider:
uv run physoce-datasets ooi-ea profiler-chl --help
Available datasets are currently as follows:
copernicus-marineeke: Eddy kinetic energy derived from altimetric sea surface height anomalies.
era5wind-stress: Wind stress derived from ERA5 10 m winds using the COARE 3.5 algorithm.
nasasst: Multi-scale Ultra-high Resolution (MUR) sea surface temperature. Currently not implemented due to issues with the API, see warning above.
ooi-eamooring-ctd: Temperature, salinity, pressure, and density derived from mooring-mounted CTDs.profiler-ctd: Mixed layer depth and stratification derived from temperature, salinity, pressure, and density from profiler-mounted CTDs.profiler-chl: Chlorophyll a derived from profiler-mounted fluorometers.
Options
All command line interfaces share the same base options:
--location: Location for the dataset in the format 'lon,lat' (e.g., '-132.0,36.55'). Required for all commands!--save-dir: Directory where the dataset file is written. If not set, defaults to.data/, relative to the current working directory.--save-file: File name to save the dataset. If not set, a default file name based on the data to be downloaded will be used.--start-date: Start date inYYYY-MM-DDformat. If not set, uses2000-01-01, or the earliest available date, whichever is later.--end-date: End date inYYYY-MM-DDformat. If not set, uses the current date or the latest available date, whicher is earlier.
Examples
Run eke download with defaults:
uv run physoce-datasets copernicus-marine eke
Run wind-stress with specified options:
uv run physoce-datasets era5 wind-stress --save-dir data --save-file wind-stress.nc --start-date 2020-01-01 --end-date 2020-01-31 --location -130,45
Python Interface
Downloaders can also be used within Python scripts and Python notebooks as well.
Importing and initializing the classes takes similar arguments as the command line interface:
from physoce_datasets import copernicus_marine
# initialize the downloader
eke_downloader = copernicus_marine.EddyKineticEnergy(
latitude=45,
longitude=-130,
start_date="2020-01-01",
end_date="2020-12-31",
save_dir="data",
save_file="eke.nc",
)
# perform the download
eke_downloader.download()
# open the dataset; **kwargs are passed to underlying xr.open_dataset() call
ds = eke_downloader.open_dataset(**kwargs)
era5 and nasa downloaders follow the exact same interface.
The OOI Endurance Array downloaders follow a slightly different notation, using the site argument rather than latitude and longitude:
from physoce_datasets import ooi_ea
# initialize the downloader
eke_downloader = ooi_ea.ProfilerCTD(
site="CE02SHSP", # case insensitive
start_date="2020-01-01",
end_date="2020-12-31",
save_dir="data",
save_file="eke.nc",
)
Available profiler sites are CE01ISSP, CE02SHSP, CE04OSPS, CE04OSPD, CE06ISSP, CE07SHSP, CE09OSPM, and RS01SBPS.
Available mooring sites are CE01ISSM, CE02SHSM, CE04OSSM, CE06ISSM, CE07SHSM, and CE09OSSM.
More information on these sites can be found at the OOI Endurance Array, the OOI Cabled Endurance Array, and the OOI Cabled Continental Margin Array sites.
If you'd like to turn off logging in scripts, you can do so with the Python standard library logging module:
import logging
# supress info logging from physoce_datasets
logging.getLogger("physoce_datasets").setLevel(logging.WARNING)
Contributions
Do you have a publicly available dataset that you've got a great download script for? Do you have specialist knowledge required for calculating derived data products? Please consider opening an issue or submitting a pull request! We welcome any and all contributions to this project.
If you'd like to contribute to the code or documentation, please refer to the developer instructions below:
-
Clone your fork to your local machine:
git clone https://github.com/your-username-here/physoce-datasets.git cd physoce-datasets
-
Setup the development environment by installing development and documentation dependencies and installing pre-commit hooks:
uv sync --dev pre-commit install
If you're only updating code, you don't need the docs group. If you're only updating docs, you do need the dev group.
-
Create a new branch with a helpful name:
git checkout -b your-great-new-feature
-
Make your code changes, stage them via
git add, and commit them withgit commit -m 'here's my great code changes'. -
Push your changes to your fork using:
git push -u origin your-great-new-feature
Thanks so much for contributing to open source code!
AI Contribution Policy
We share the same AI Usage Policy as xarray. In short, this allows developers to use AI tools as a part of their development workflow, but requires that contributors understand all submitted code and take full responosiblity for their changes.
Metadata
Release files for physoce-datasets 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| physoce_datasets-0.5.3.tar.gz | 244.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| physoce_datasets-0.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 277.7 kB
Release files / physoce_datasets-0.5.3.tar.gz
| Download URL | physoce_datasets-0.5.3.tar.gz |
|---|---|
| Size | 244.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25335b9a8be5f606f114970ecaa2d005a09e485e672ac433d8a427e602f21697
|
|
BLAKE2b-256 checksum How to use checksums |
b0886ac719b40a74e659647489397b9b60fba99371aae4cc6245a91264e0f6cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logRelease files / physoce_datasets-0.5.3-py3-none-any.whl
| Download URL | physoce_datasets-0.5.3-py3-none-any.whl |
|---|---|
| Size | 33.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30ca3a73a8b89bb3ff35e94da28b27d528293270f03be3cb3e5b32d92ac66181
|
|
BLAKE2b-256 checksum How to use checksums |
f4148c8d0f552d6b6e6821c16083b40498ec9a9970b89dfb27f04c9a68e76363
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency log