Skip to content

Commit

Permalink
Merge pull request #13 from DHI-GRAS/cdse
Browse files Browse the repository at this point in the history
Switch from Creodias to Copernicus Data Space Ecosystem for data search and download
  • Loading branch information
radosuav committed Jul 4, 2023
2 parents 23cc7f0 + af7cfa6 commit 70edb5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# creodias-finder
Query the [CREO Data finder API](https://creodias.eu/eo-data-finder-api-manual) for available
Query the [Copernicus Data Space Ecosystem (CDSE) OpenSearch service](https://documentation.dataspace.copernicus.eu/APIs/OpenSearch.html) for available
products.

Note: This is just a proof of concept, not finished, thoroughly tested or fully developed. You are still welcome to use it and also to submit pull requests fixing bugs you may find.
**Note:**
The name of the package (creodias-finder) comes from its heritage, when it was used to search for data stored in Creodias service. With CDSE reaching maturity it was decided to start using the Copernicus service. To download the data an [account on CDSE](https://dataspace.copernicus.eu/) is required.



This is just a proof of concept, not finished, thoroughly tested or fully developed. You are still welcome to use it and also to submit pull requests fixing bugs you may find.

## Usage

Expand Down Expand Up @@ -65,8 +70,8 @@ from creodias_finder import download
ids = [result['id'] for result in results.values()]

CREDENTIALS = {
"username": 'my-creodias-email',
"password": 'my-creodias-password'
"username": 'my-cdse-email',
"password": 'my-cdse-password'
}

# download single product by product ID
Expand Down
6 changes: 2 additions & 4 deletions creodias_finder/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
from tqdm import tqdm

DOWNLOAD_URL = "https://zipper.creodias.eu/download"
TOKEN_URL = (
"https://identity.cloudferro.com/auth/realms/DIAS/protocol/openid-connect/token"
)
TOKEN_URL = "https://identity.dataspace.copernicus.eu/auth/realms/CDSE/protocol/openid-connect/token"


def _get_token(username, password):
token_data = {
"client_id": "CLOUDFERRO_PUBLIC",
"client_id": "cdse-public",
"username": username,
"password": password,
"grant_type": "password",
Expand Down
2 changes: 1 addition & 1 deletion creodias_finder/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re

API_URL = (
"http://datahub.creodias.eu/resto/api/collections/{collection}"
"https://catalogue.dataspace.copernicus.eu/resto/api/collections/{collection}"
"/search.json?maxRecords=1000"
)
ONLINE_STATUS_CODES = "34|37|0"
Expand Down

0 comments on commit 70edb5a

Please sign in to comment.