Skip to main content

Copernicus Marine Service - CLI

A command-line tool for downloading and converting Copernicus Marine Service datasets to GeoTIFF format. This tool simplifies access to oceanographic data including currents, waves, wind, and scalar parameters.

PyPI version Python 3.12+ License: CC BY-NC 4.0

Table of Content

Features

  • Download Copernicus Marine Service datasets in NetCDF format
  • Convert ocean parameters to GeoTIFF format with spatial interpolation
  • Generate specialized GeoTIFFs for:
    • Ocean currents (speed and direction)
    • Wave parameters (height and direction)
    • Wind data (speed and direction)
    • Scalar parameters (temperature, salinity, etc.)
  • Configurable spatial resolution and bounding boxes
  • Command-line interface for automation and scripting

Installation

Requires: Python >=3.12

End User Installation

Install via pip:

pip install cms-cli

Or using uv (recommended):

uv pip install cms-cli

Configuration

Before using the CLI, you need to configure your Copernicus Marine Service credentials.

Usage as library

Create a .env file in the root directory of your project with the following content:

CMS_USER
CMS_PASSWORD

Or set them as environment variables:

export CMS_USER="your_username"
export CMS_PASSWORD="your_password"

Development Installation

  1. Copy the .env.example file to .env:

    cp .env.example .env
    
  2. Edit .env and add your credentials:

    nano .env  # Or use any text editor
    

You can obtain credentials by registering at the Copernicus Marine Service.

Usage

After installation, run the CLI using:

cms-cli --help

Development Installation

For contributing or development:

git clone https://github.com/EomapCompany/cms-cli
cd cms-cli

# Install with all development dependencies
uv sync --all-groups

Run tests:

uv run pytest tests/ -v

Commands Overview

Command Description
download-netcdf Download original dataset with multiple parameters in NetCDF format
create-scalar-geotiffs Download dataset and create GeoTIFFs for scalar parameters (e.g., temperature, salinity)
create-current-geotiffs Download dataset and create current GeoTIFFs (speed and direction)
create-wave-geotiffs Download dataset and create wave GeoTIFFs (height and direction)
create-wind-geotiffs Download dataset and create wind GeoTIFFs (speed and direction)

Examples

Download NetCDF data

cms-cli download-netcdf \
  --dataset-id cmems_mod_glo_phy_my_0.083deg_P1D-m \
  --variables thetao \
  --start-date 2024-01-01 \
  --end-date 2024-01-31 \
  --output-dir ./data

Create scalar GeoTIFFs

cms-cli create-scalar-geotiffs \
  --dataset-id cmems_mod_glo_phy_my_0.083deg_P1D-m \
  --variable thetao \
  --start-date 2024-01-01 \
  --end-date 2024-01-31 \
  --resolution 1000 \
  --output-dir ./output

Create current GeoTIFFs with bounding box

cms-cli create-current-geotiffs \
  --dataset-id cmems_mod_glo_phy_my_0.083deg_P1D-m \
  --u-variable uo \
  --v-variable vo \
  --start-date 2024-01-01 \
  --end-date 2024-01-31 \
  --bbox -10 35 5 45 \
  --resolution 1000 \
  --output-dir ./currents

Development

Running Tests

uv run pytest tests/ -v

Code Quality

This project uses ruff for linting and formatting:

uv run ruff check .
uv run ruff format .

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0) - see the LICENCE.md file for details.

Copyright (c) 2025 EOMAP

Acknowledgments

This tool uses the Copernicus Marine Service API to access ocean data.

Metadata

Release files for cms-cli 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cms-cli 0.0.2
File Size Uploaded
cms_cli-0.0.2.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cms-cli 0.0.2
File Interpreter ABI Platform
cms_cli-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / cms_cli-0.0.2.tar.gz

Download URL cms_cli-0.0.2.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
431ae690713452cbe6a9c36a5903434e6e14ee96377b5d3fb94ceb13824f37a0
BLAKE2b-256 checksum
How to use checksums
04ed849dd692f0801a8394bc51b46af81945a60749e9a0161d644a947ae1ab8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cms_cli-0.0.2-py3-none-any.whl

Download URL cms_cli-0.0.2-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e39023e1175fb046466ba4ac90e5b69cb45566ac4fce3c4ad4cc4dd0845f26f
BLAKE2b-256 checksum
How to use checksums
8a577c9392be6055be11593d07a6467c67d01feb19f38e75a9f768f0e375b0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.0.3

2 release files

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page