rs_server_common/data_retrieval/provider.md
Provider mechanism.
CreateProviderFailed
Bases: Exception
Exception raised when an error occurred during the init of a provider.
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
53 54 | |
DownloadProductFailed
Bases: Exception
Exception raised when an error occurred during the download.
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
61 62 | |
Product
dataclass
A product.
A product has an external identifier and a dictionary of metadata.
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
42 43 44 45 46 47 48 49 50 | |
Provider
Bases: ABC
A product provider.
A provider gives a common interface to search for files from an external data source and download them locally.
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
download(product_id, to_file)
abstractmethod
Download the given product to the given local path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_id
|
str
|
id of the product to download |
required |
to_file
|
Path
|
path where the file should be downloaded |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
101 102 103 104 105 106 107 108 109 110 111 112 | |
search(**kwargs)
Search for products with the given time range.
The search result is a dictionary of products found indexed by id.
Returns:
| Type | Description |
|---|---|
Any
|
The files found indexed by file id. Specific to each provider. |
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
SearchProductFailed
Bases: Exception
Exception raised when an error occurred during the search.
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
57 58 | |
TimeRange
dataclass
A time range.
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
duration()
Duration of the timerange.
Returns: duration of the timerange
Source code in docs/rs-server/services/common/rs_server_common/data_retrieval/provider.py
31 32 33 34 35 36 | |