Skip to content
CIOOS

Ocean Data Parser

A python tool to parse common ocean data proprietary formats.

Get started Go to GitHub

Compatibility

Compatible with a number of broadly used proprietary formats

Standards

Follow common metadata standards: CF, ACDD, IOOS, etc

Integration

Seamless Integration with xarray and command line interface available

Documentation

Notebook examples and api documentation available

Installation

First, install the uv package manager

pip install uv

Next, clone the repository to your local machine, enter the project directory and use uv sync to setup the package.

git clone https://github.com/cioos-siooc/ocean-data-parser
cd ocean-data-parser
uv sync --python 3.9

This process will create a Python 3.9 virtual environment in the a .venv directory and populate it with the packages described in the pyproject.toml and uv.lock files.

Activate the new environment

source .venv/bin/activate

Test the install

odpy --version

How to

via Command Line Interface odpy

Once installed, the package is usable via the command line interface via the odpy command. As an example to convert a series of cnv files to netcdf, you can use the following command:

odpy convert -i '**/*.cnv'

For futher details see here or run the following command:

odpy --help 

via ocean_data_parser.read.file

Load a compatible file with the global read.file method

from ocean_data_parser import read
from ocean_data_parser import read

# Load a file to an xarray object
ds = read.file('Path to file')

# Save to netcdf
ds.to_netcdf('save-path.nc')

via from ocean_data_parser.parsers import ...

Or specify the specific parser to use for this file format:

from ocean_data_parser.parsers import ...
from ocean_data_parser.parsers import seabird

# Load a seabird cnv file as an xarray dataset
ds = seabird.cnv('Path to seabird cnv file')

# Save to netcdf
ds.to_netcdf('save-path.nc')