Skip to main content

A cli for downloading and converting Copernicus Marine Service datasets to GeoTIFFs

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cms_cli-0.0.1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cms_cli-0.0.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file cms_cli-0.0.1.tar.gz.

File metadata

  • Download URL: cms_cli-0.0.1.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","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}

File hashes

Hashes for cms_cli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 60f95b0bb664caf4209dd24ee798c03dd97633ebf81e517b0b325722b6330da6
MD5 a5ae13c0d947175dd3ac100daf9f7936
BLAKE2b-256 287e3b6d75472300535a08c3efdcd9f1a400d06400b81a06681b9c765e0a9fb0

See more details on using hashes here.

File details

Details for the file cms_cli-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cms_cli-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","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}

File hashes

Hashes for cms_cli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f2923eb77be090d7eeca92cd4fa039e2c1eecc1860929337e55b18fcae7a3cd
MD5 503cc2ed9d148108b4a099d194bdde61
BLAKE2b-256 c69d7a6856289a8e2ef7713f92a6b21d42aba1f4f44711098be43a7b8ff64267

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page