{"id":27665,"library":"copernicusmarine","title":"Copernicus Marine Data Store Client","description":"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.","status":"active","version":"2.4.0","language":"python","source_language":"en","source_url":"https://github.com/COPERNICUS-Marine/MyOcean-dashboard","tags":["copernicus","marine","oceanography","data","cli","cmems"],"install":[{"cmd":"pip install copernicusmarine","lang":"bash","label":"Install from PyPI"},{"cmd":"conda install -c conda-forge copernicusmarine","lang":"bash","label":"Install from conda-forge"}],"dependencies":[],"imports":[{"note":"Main module; submodules like copernicusmarine.open_dataset or copernicusmarine.describe are accessed via dot notation.","wrong":null,"symbol":"copernicusmarine","correct":"import copernicusmarine"},{"note":"Direct function imports broke in v2.0; use module-level access.","wrong":"from copernicusmarine import open_dataset  # deprecated in v2.x","symbol":"open_dataset","correct":"import copernicusmarine\ncopernicusmarine.open_dataset(...)"}],"quickstart":{"code":"import copernicusmarine\nimport os\n\n# Describe available datasets (requires internet)\ncopernicusmarine.describe()\n\n# Download a sample dataset (with authentication, using env vars)\ncopernicusmarine.subset(\n    dataset_id=\"cmems_mod_glo_phy_my_0.083deg_P1M-m\",\n    variables=[\"thetao\"],\n    minimum_longitude=0,\n    maximum_longitude=10,\n    minimum_latitude=40,\n    maximum_latitude=45,\n    start_datetime=\"2021-01-01T00:00:00\",\n    end_datetime=\"2021-01-01T00:00:00\",\n    username=os.environ.get(\"COPERNICUSMARINE_USERNAME\", \"\"),\n    password=os.environ.get(\"COPERNICUSMARINE_PASSWORD\", \"\"),\n    output_filename=\"sample_data.nc\"\n)","lang":"python","description":"Authenticate and download a subset of global ocean physics data as NetCDF."},"warnings":[{"fix":"Use authentication via parameters or env vars; do not use copernicusmarine.login().","message":"In v2.x, the login function was removed; you must pass credentials directly to subset() or set environment variables COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace open_dataset() calls with subset() for file-based access or use xarray with fsspec via the Copernicus Marine toolbox.","message":"The open_dataset() function is deprecated in v2.3+ and will be removed in v3.0. Use the subset() method with appropriate parameters.","severity":"deprecated","affected_versions":">=2.3.0"},{"fix":"Ensure network access and set COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD environment variables for non-interactive use.","message":"The library requires an active internet connection and authentication even for describe() if you are behind a firewall. The CLI may cache credentials in ~/.copernicusmarine.","severity":"gotcha","affected_versions":"all"},{"fix":"Split the request into smaller chunks or use the MOTU API directly for heavy downloads.","message":"When using subset() with a large geographic or temporal range, the request may time out or generate a very large file. Prefer multiple smaller requests.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Remove login() call. Pass username and password as arguments to subset() or set environment variables COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD.","cause":"In v2.x, the login function was removed. Users upgrading from v1.x try to call copernicusmarine.login().","error":"copernicusmarine.login() missing or AttributeError: module 'copernicusmarine' has no attribute 'login'"},{"fix":"Use copernicusmarine.open_dataset() or switch to copernicusmarine.subset().","cause":"Direct import of open_dataset from copernicusmarine is deprecated in v2.3+ and removed in some versions.","error":"ImportError: cannot import name 'open_dataset' from 'copernicusmarine'"},{"fix":"Set COPERNICUSMARINE_USERNAME and COPERNICUSMARINE_PASSWORD environment variables, or pass username and password to the function.","cause":"Authentication is required but no username/password given via parameters or environment variables.","error":"copernicusmarine.exceptions.CredentialsException: No credentials provided"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}