Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ecmwf/cdsapi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.7.4
Choose a base ref
...
head repository: ecmwf/cdsapi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.7.5
Choose a head ref
  • 4 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 24, 2024

  1. Update README.rst (#127)

    EddyCMWF authored Oct 24, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    491e53f View commit details
  2. Update README.rst (#128)

    EddyCMWF authored Oct 24, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c1eb4d9 View commit details

Commits on Nov 19, 2024

  1. Migrate to datapi (#132)

    * use datapi dependency
    malmans2 authored Nov 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cdcde16 View commit details

Commits on Nov 28, 2024

  1. Preparing release (#134)

    EddyCMWF authored Nov 28, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fa3a605 View commit details
Showing with 15 additions and 9 deletions.
  1. +8 −3 README.rst
  2. +3 −2 cdsapi/api.py
  3. +2 −2 setup.py
  4. +2 −2 tests/test_api.py
11 changes: 8 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
cdsapi
------

For a more detailed description on how to use the cdsapi, please visit: https://cds.climate.copernicus.eu/how-to-api


Install
-------
@@ -10,12 +15,12 @@ Install via `pip` with::
Configure
---------

Get your user ID (UID) and API key from the CDS portal at the address https://cds.climate.copernicus.eu/user
Get your Personal Access Token from your profile on the CDS portal at the address: https://cds.climate.copernicus.eu/profile
and write it into the configuration file, so it looks like::

$ cat ~/.cdsapirc
url: https://cds.climate.copernicus.eu/api/v2
key: <UID>:<API key>
url: https://cds.climate.copernicus.eu/api
key: <PERSONAL-ACCESS-TOKEN>

Remember to agree to the Terms and Conditions of every dataset that you intend to download.

5 changes: 3 additions & 2 deletions cdsapi/api.py
Original file line number Diff line number Diff line change
@@ -281,9 +281,10 @@ def __new__(cls, url=None, key=None, *args, **kwargs):
_, token, _ = get_url_key_verify(url, key, None)
if ":" in token:
return super().__new__(cls)
import cads_api_client.legacy_api_client

return super().__new__(cads_api_client.legacy_api_client.LegacyApiClient)
import datapi.legacy_api_client

return super().__new__(datapi.legacy_api_client.LegacyApiClient)

def __init__(
self,
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ def read(fname):
return io.open(file_path, encoding="utf-8").read()


version = "0.7.4"
version = "0.7.5"


setuptools.setup(
@@ -46,7 +46,7 @@ def read(fname):
include_package_data=True,
python_requires=">=3.8",
install_requires=[
"cads-api-client>=1.4.7",
"datapi",
"requests>=2.5.0",
"tqdm",
],
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import cads_api_client.legacy_api_client
import datapi.legacy_api_client
import pytest

import cdsapi
@@ -33,7 +33,7 @@ def test_request():
),
(
"",
cads_api_client.legacy_api_client.LegacyApiClient,
datapi.legacy_api_client.LegacyApiClient,
),
],
)