# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['copernicus_marine_client',
 'copernicus_marine_client.catalogue_parser',
 'copernicus_marine_client.command_line_interface',
 'copernicus_marine_client.core_functions',
 'copernicus_marine_client.download_functions',
 'copernicus_marine_client.python_interface']

package_data = \
{'': ['*']}

install_requires = \
['aiohttp>=3.8.3',
 'boto3>=1.28.2,<2.0.0',
 'cachier>=2.0.2',
 'click>=8.0.4',
 'dask>=2022.1.1',
 'motuclient==1.8.4',
 'netCDF4>=1.6.3',
 'numpy>=1.0',
 'owslib>=0.27.2',
 'pydap>=3.2.2',
 'requests>=2.27.1',
 'setuptools>=62.0.0',
 'tqdm>=4.65.0',
 'xarray>=2023.3.0',
 'zarr>=2.13.3']

entry_points = \
{'console_scripts': ['copernicus-marine = '
                     'copernicus_marine_client.command_line_interface.copernicus_marine:command_line_interface']}

setup_kwargs = {
    'name': 'copernicus-marine-client',
    'version': '0.8.19',
    'description': '',
    'long_description': '\n<center><h1>Copernicus Marine Service client (CLI & Python)</h1></center>\n<div align="center">\n  <a href="https://pypi.org/project/copernicus-marine-client/"><img src="https://img.shields.io/pypi/v/copernicus-marine-client.svg?style=flat-square" alt="PyPI" /></a>\n  <a href="https://pypi.org/project/copernicus-marine-client/"><img src="https://img.shields.io/pypi/pyversions/copernicus-marine-client.svg?style=flat-square" alt="PyPI Supported Versions" /></a>\n  <a href="https://pypi.org/project/copernicus-marine-client/"><img src="https://img.shields.io/badge/platform-windows | linux | macos-lightgrey?style=flat-square" alt="Supported Platforms" /></a>\n</div>\n\n![Copernicus Marine Service and Mercator Ocean international logos](https://www.mercator-ocean.eu/wp-content/uploads/2022/05/Cartouche_CMEMS_poisson_MOi.png)\n\n## Features\nThe `copernicus-marine-client` offers capabilities through both **Command Line Interface (CLI)** and **Python** usages:\n- **Metadata Information**: List and retrieve metadata information on all variables, datasets, products, and their associated documentation.\n- **Subset Datasets**: Subset datasets to extract only the parts of interest, in preferred format, such as Analysis-Ready Cloud-Optimized (ARCO) Zarr or NetCDF file format.\n- **Advanced Filters**: Apply simple or advanced filters to get multiple files, in original formats like NetCDF/GeoTIFF, via direct Marine Data Store connections.\n- **No Quotas**: Enjoy no quotas, neither on volume size nor bandwidth.\n\n## Installation\nFor installation, multiple options are available depending on your setup:\n\n### Conda|Mamba\nThough no conda package has been created yet, these steps cover the installation in a new isolated environment (safer). Replace conda by mamba if necessary.\n\n- Create the file `copernicus-marine-client-env.yml` that contains:\n```yaml\nname: cmc\nchannels:\n  - conda-forge\ndependencies:\n  - pip\n  - pip:\n    - copernicus-marine-client\n```\n\n- Use the terminal or a [Conda|Mamba] Prompt to create the `cmc` environment from the `yml` file:\n```bash\nconda env create --file copernicus-marine-client-env.yml\n```\n\n- Open the new `cmc` environment by running:\n```bash\nconda activate cmc\n```\n\n- Verify that the new `cmc` environment was installed correctly:\n```bash\nconda env list\n```\n\n### Pip\nOtherwise, if you already have an environment (safer to clone it), the package can be installed using the `pip` command:\n```bash\npython -m pip install copernicus-marine-client\n```\n\nAnd to **upgrade the package** to the newest available version, run:\n```bash\npython -m pip install copernicus-marine-client --upgrade\n```\n\n## User Guide\nFor more comprehensive details on how to use the `copernicus-marine-client`, please refer to our [Help Center](https://help.marine.copernicus.eu/en/collections/4060068-copernicus-marine-client). It ensures a smooth migration for existing users of legacy services such as MOTU, OPeNDAP, and FTP.\n\n## Command Line Interface (CLI)\n\n### The `--help` option\nTo discover commands and their available options, consider appending `--help` on any command line.\n\nExample:\n```bash\ncopernicus-marine --help\n```\nReturns:\n```bash\nUsage: copernicus-marine [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -V, --version  Show the version and exit.\n  --help         Show this message and exit.\n\nCommands:\n  describe  Print Copernicus Marine catalog as JSON\n  login     This command check the copernicus-marine credentials provided...\n  get       Download originally produced data files\n  subset    Downloads subsets of datasets as NetCDF files or Zarr stores\n```\n\n### Command `describe`\nRetrieve metadata information about all products/datasets and display as JSON output:\n```bash\ncopernicus-marine describe --include-datasets\n```\n\nThe JSON output can also be saved like follows:\n```bash\ncopernicus-marine describe --include-datasets > all_datasets_copernicus-marine.json\n```\n\n### Command `login`\nCreate a single configuration file `.copernicus_marine_client_credentials` allowing to access all Marine Data Store data services. By default, it saves file in user\'s home directory.\n\nExample:\n```bash\n> copernicus-marine login\nusername : johndoe\npassword :\nINFO - root - Configuration files stored in /Users/foo/.copernicus_marine_client\n```\n\nIf `.copernicus_marine_client_credentials` already exists, the user is asked for confirmation to overwrite (`--overwrite`/`--overwrite-configuration-file`).\n\n#### Access points migration and evolution\n\nIf you already have a configuration for current services (e.g. `~/motuclient/motuclient-python.ini`, `~/.netrc` or `~/_netrc`) in your home directory, it will automatically be taken into account with commands `get` and `subset` without the need for running the `login` command.\nIf the configuration files are already available in another directory, when running commands `subset` or `get`, you can use the `--configuration-file-directory` option to specify the path.\n\n### Command `subset`\nRemotely subset a dataset, based on variable names, geographical and temporal parameters.\n\nExample:\n```bash\ncopernicus-marine subset --dataset-id cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m --variable thetao --variable so --start-datetime 2021-01-01 --end-datetime 2021-01-03 --minimal-longitude 0.0 --maximal-longitude 0.1 --minimal-latitude 28.0 --maximal-latitude 28.1\n```\nReturns:\n```bash\nINFO     - root - Download through S3\n<xarray.Dataset>\nDimensions:    (depth: 50, latitude: 2, longitude: 1, time: 1)\nCoordinates:\n  * depth      (depth) float32 0.5058 1.556 2.668 ... 5.292e+03 5.698e+03\n  * latitude   (latitude) float32 28.0 28.08\n  * longitude  (longitude) float32 0.08333\n  * time       (time) datetime64[ns] 2021-01-01\nData variables:\n    thetao     (time, depth, latitude, longitude) float32 dask.array<chunksize=(1, 50, 2, 1), meta=np.ndarray>\n    so         (time, depth, latitude, longitude) float32 dask.array<chunksize=(1, 50, 2, 1), meta=np.ndarray>\nAttributes: (12/19)\n    Conventions:    CF-1.0\n    bulletin_date:  2022-11-01\n    ...             ...\n    title:          CMEMS IBI REANALYSIS: YEARLY PHYSICAL PRODUCTS\nDo you want to proceed with download? [Y/n]:\n```\n\nBy default, after the display of the summary of the dataset subset, a download confirmation is asked. To skip this user\'s action, call option `--force-download`.\n\n#### Note about longitude range\nOptions `--minimal-longitude` and `--maximal-longitude` work as follows:\n- If the result of the substraction ( `--maximal-longitude` minus `--minimal-longitude` ) is superior or equal to 360, then return the full dataset.\n- If the requested longitude range:\n  - **does not cross** the antemeridian, then return the dataset between range -180° and 180°.\n  - **does cross** the antemeridian, then return the dataset between range 0° and 360°.\n\nNote that you can request any longitudes you want. A modulus is applied to bring the result between -180° and 360°. For example, if you request [530°, 560°], the result dataset will be in [170°, 200°].\n\n#### Access point migration and evolution\nThe copernicus marine client will download the data in the most efficient way according to your request:\n- if the target dataset **is available** in ARCO version, then files are downloaded in a fresh new `data.zarr` folder in the current working directory.\n- if the target dataset **is not yet available** in ARCO version, then a `data.nc` file is downloaded in the current working directory.\n\nHowever, the output directory and filename can be specified using `-o`/`--output-directory` and `-f`/`--output-filename` respectively. If the later ends with `.nc`, it will be written as a NetCDF file.\n\nYou can force the use of a specific data access service with option `--force-service`.\n\n### Command `get`\nDownload the dataset file(s) as originally produced, based on the datasetID or the path to files.\n\nExample:\n```bash\ncopernicus-marine get --dataset-url ftp://my.cmems-du.eu/Core/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m\n```\nReturns:\n```bash\nINFO     - root - Downloading using service ftp...\nINFO     - root - You requested the download of the following files:\nCore/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_19930101_19931231_R20221101_RE01.nc - 8.83 MB\n[... truncated for brevity..]\nCore/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20120101_20121231_R20221101_RE01.nc - 8.62 MB\nPrinted 20 out of 29 files\n\nTotal size of the download: 252.94 MB\nDo you want to proceed with download? [Y/n]:\n```\n\nBy default:\n- after the header displays a summary of the request, a download confirmation is asked. To skip this user\'s action, add option `--force-download`.\n- files are downloaded to the current directory applying the original folder structure. To avoid this behavior, add `--no-directories` and specify a destination with the `--output-directory` option.\n\nOption `--show-outputnames` displays the full paths of the output files, if required.\n\n#### Note about filtering options\nOption `--filter` allows to specify a Unix shell-style wildcard pattern (see [fnmatch — Unix filename pattern matching](https://docs.python.org/3/library/fnmatch.html)) and select specific files:\n```bash\ncopernicus-marine get --dataset-id cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m --filter "*01yav_200[0-2]*"\n```\nReturns:\n```bash\nINFO     - root - Downloading using service files...\nINFO     - root - You requested the download of the following files:\ns3://mdl-native/native/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m_202211/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20000101_20001231_R20221101_RE01.nc - 8.93 MB\ns3://mdl-native/native/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m_202211/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20010101_20011231_R20221101_RE01.nc - 8.91 MB\ns3://mdl-native/native/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m_202211/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20020101_20021231_R20221101_RE01.nc - 8.75 MB\n\nTotal size of the download: 26.59 MB\nDo you want to proceed with download? [Y/n]:\n```\n\nOption `--regex` allows to specify a regular expression for more advanced files selection:\n```bash\ncopernicus-marine get -i cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m --regex ".*01yav_20(00|01|02).*.nc"\n```\nReturns:\n```bash\nINFO     - root - Downloading using service files...\nINFO     - root - You requested the download of the following files:\ns3://mdl-native/native/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m_202211/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20000101_20001231_R20221101_RE01.nc - 8.93 MB\ns3://mdl-native/native/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m_202211/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20010101_20011231_R20221101_RE01.nc - 8.91 MB\ns3://mdl-native/native/IBI_MULTIYEAR_PHY_005_002/cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m_202211/CMEMS_v5r1_IBI_PHY_MY_NL_01yav_20020101_20021231_R20221101_RE01.nc - 8.75 MB\n\nTotal size of the download: 26.59 MB\nDo you want to proceed with download? [Y/n]:\n```\n\n### Shared options\nBoth `subset` and `get` commands provide these options:\n\n#### Option `--overwrite-output-data`\n\nWhen specified, the existing files will be overwritten.\nOtherwise, if the files already exist on destination, new ones with a unique index will be created once the download has been accepted (or once `--force-download` is provided).\n\n#### Option `--request-file`\n\nThis option allows to specify CLI options but in a provided JSON file, useful for batch processing.\n\n- Template for `subset` data request:\n```json\n{\n\t"dataset_id": "cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m",\n\t"start_datetime": "2022-04-11",\n\t"end_datetime": "2023-08-11",\n\t"minimal_longitude": -182.79,\n\t"maximal_longitude": -179.69,\n\t"minimal_latitude": -40,\n\t"maximal_latitude": -36,\n\t"minimal_depth": 0,\n\t"maximal_depth": 0,\n\t"variables": ["thetao"],\n\t"output_directory": "./data/",\n\t"output_filename": "temperature_small_pacific_2022208-202308.zarr",\n\t"force_download": false\n}\n```\n\nExample:\n```bash\ncopernicus-marine subset --request-file template_subset_data_request.json\n```\n\n- Template for `get` data request:\n```json\n{\n    "dataset_id": "cmems_mod_ibi_phy_my_0.083deg-3D_P1Y-m",\n    "filter": "*01yav_200[0-2]*",\n    "force_download": false,\n    "force_service": "files",\n    "log_level": "INFO",\n    "no_directories": false,\n    "no_metadata_cache": false,\n    "output_directory": "./data/",\n    "overwrite_output_data": false,\n    "overwrite_metadata_cache": false,\n    "show_outputnames": true\n}\n```\n\nExample:\n```bash\ncopernicus-marine get --request-file template_get_data_request.json\n```\n## Python interface\nThe `copernicus-marine-client` exposes a Python interface to allow you to [call commands as functions](https://marine.copernicus.eu/python-interface).\n\n## Documentation\nSee the [Help Center](https://help.marine.copernicus.eu/en/collections/4060068-copernicus-marine-client). A detailed standalone API documentation is under construction and will come at a later stage.\n\n## Contribution\nWe welcome contributions from the community to enhance this package. If you find any issues or have suggestions for improvements, please check out our [Report Template](https://help.marine.copernicus.eu/en/articles/8218546-how-to-report-a-bug-or-suggest-new-features).\n\n## Future improvements & Roadmap\n- [ ] Make available the currently not managed Analysis-Ready Cloud-Optimized (ARCO) versions of Ocean Monitoring Indicator (OMI), in situ and static datasets.\n- [ ] Allow to specify the compression level when downloading your subset as NetCDF file.\n- [ ] Allow to subset variables using their `standard_name(s)` and not only their `name(s)`.\n\nTo keep up to date with the most recent and planned advancements, including revisions, corrections, and feature requests generated from users\' feedback, please refer to our [Roadmap](https://help.marine.copernicus.eu/en/articles/8218641-what-are-the-next-milestones).\n\n## Join the community\nGet in touch!\n- Create your [Copernicus Marine Account](https://data.marine.copernicus.eu/register)\n- [Log in](https://data.marine.copernicus.eu/login?redirect=%2Fproducts) and chat with us (bottom right corner of [Copernicus Marine Service](https://marine.copernicus.eu/))\n- Join our [training workshops](https://marine.copernicus.eu/services/user-learning-services)\n- Network y/our [Copernicus Stories](https://twitter.com/cmems_eu)\n- Watch [our videos](https://www.youtube.com/channel/UC71ceOVy7WtVC7F04BKoEew)\n',
    'author': 'Copernicus Marine User Support',
    'author_email': 'servicedesk.cmems@mercator-ocean.eu',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.9',
}


setup(**setup_kwargs)
