Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support older pythons #56

Open
manfredsc opened this issue Aug 6, 2024 · 1 comment
Open

Support older pythons #56

manfredsc opened this issue Aug 6, 2024 · 1 comment

Comments

@manfredsc
Copy link

With the switch from CDS to CDS-Beta, the python module cads-api-client has become an operational
component of the API interface, it is unconditionally needed when downloading data from CDS-Beta.

In cdsapi/api.py, there is the following code:

        if ":" in token:
            return super().__new__(cls)
        import cads_api_client.legacy_api_client
        return super().__new__(cads_api_client.legacy_api_client.LegacyApiClient)

Tokens for CDS-Beta have no colons, and therefore cads_api_client.legacy_api_client.LegacyApiClient is executed.

So far cdsapi was happily running on python 3.6. However, cads-api-client does not work with python 3.6:

[   22s]   File "/usr/lib/python3.6/site-packages/cads_api_client/catalogue.py", line 1
[   22s] SyntaxError: future feature annotations is not defined
[   22s] 
[   22s]   File "/usr/lib/python3.6/site-packages/cads_api_client/legacy_api_client.py", line 1
[   22s] SyntaxError: future feature annotations is not defined
[   22s] 
[   22s]   File "/usr/lib/python3.6/site-packages/cads_api_client/processing.py", line 95
[   22s]     if not (content := message.get("content")):
[   22s]                     ^
[   22s] SyntaxError: invalid syntax

It seems it would be not a lot of effort to make cads-api-client run on python 3.6. On some older Linux
distributions, including enterprise distributions, python 3.6 is all one can get, and doing a local, private installation of
the whole python stack is not really attractive.

Please keep your API code as generic as possible, cdsapi is the only possibility to do automated requests from CDS.

I also posted this request on the cdsapi project page to increase awareness.
Thanks for consideration!

@khufkens
Copy link

I'm going to echo the generic comment.

Where the previous cdsapi was rather transparent (even without documentation) I could easily write both CDS/ADS equivalent libraries for R (https://github.com/bluegreen-labs/ecmwfr). cadsapi is however even less transparent and robust (with respect to versioning and wide support).

@manfredsc If you know the specs for the authentication (curl based) I would love to hear it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants