Registry / data / copernicusmarine

copernicusmarine

JSON →
library2.4.0pypypi✓ verified 85d ago

Python library and CLI for accessing and downloading marine data from the Copernicus Marine Service (CMEMS). Version 2.4.0 requires Python >=3.10. Released under Apache-2.0, with regular updates.

pip install copernicusmarine
INSTALL
IMPORT
SIG · COPERNICUSMARINE
C
copernicusmarine
datapythonv2.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

copernicusmarine
import copernicusmarine
Main module; submodules like copernicusmarine.open_dataset or copernicusmarine.describe are accessed via dot notation.
open_dataset
import copernicusmarine copernicusmarine.open_dataset(...)
from copernicusmarine import open_dataset # deprecated in v2.x
Direct function imports broke in v2.0; use module-level access.

Authenticate and download a subset of global ocean physics data as NetCDF.

import copernicusmarine import os # Describe available datasets (requires internet) copernicusmarine.describe() # Download a sample dataset (with authentication, using env vars) copernicusmarine.subset( dataset_id="cmems_mod_glo_phy_my_0.083deg_P1M-m", variables=["thetao"], minimum_longitude=0, maximum_longitude=10, minimum_latitude=40, maximum_latitude=45, start_datetime="2021-01-01T00:00:00", end_datetime="2021-01-01T00:00:00", username=os.environ.get("COPERNICUSMARINE_USERNAME", ""), password=os.environ.get("COPERNICUSMARINE_PASSWORD", ""), output_filename="sample_data.nc" )
copernicusmarine --version
Debug
Known issues
breakingIn v2.x, the login function was removed; you must pass credentials directly to subset() or set environment variables COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD.
fix
Use authentication via parameters or env vars; do not use copernicusmarine.login().
affects: >=2.0.0
deprecatedThe open_dataset() function is deprecated in v2.3+ and will be removed in v3.0. Use the subset() method with appropriate parameters.
fix
Replace open_dataset() calls with subset() for file-based access or use xarray with fsspec via the Copernicus Marine toolbox.
affects: >=2.3.0
gotchaThe library requires an active internet connection and authentication even for describe() if you are behind a firewall. The CLI may cache credentials in ~/.copernicusmarine.
fix
Ensure network access and set COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD environment variables for non-interactive use.
affects: all
gotchaWhen using subset() with a large geographic or temporal range, the request may time out or generate a very large file. Prefer multiple smaller requests.
fix
Split the request into smaller chunks or use the MOTU API directly for heavy downloads.
affects: all
Errors
Common errors & fixes
copernicusmarine.login() missing or AttributeError: module 'copernicusmarine' has no attribute 'login'
In v2.x, the login function was removed. Users upgrading from v1.x try to call copernicusmarine.login().
fix
Remove login() call. Pass username and password as arguments to subset() or set environment variables COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD.
ImportError: cannot import name 'open_dataset' from 'copernicusmarine'
Direct import of open_dataset from copernicusmarine is deprecated in v2.3+ and removed in some versions.
fix
Use copernicusmarine.open_dataset() or switch to copernicusmarine.subset().
copernicusmarine.exceptions.CredentialsException: No credentials provided
Authentication is required but no username/password given via parameters or environment variables.
fix
Set COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD environment variables, or pass username and password to the function.
Upgrade
Version history
2.4.0latest on PyPI · released Apr 20, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
copernicusmarine — pip install copernicusmarine · libregistry