eodag 3.9.0__py3-none-any.whl → 3.9.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,42 +149,38 @@ def format_metadata(search_param: str, *args: Any, **kwargs: Any) -> str:
149
149
  """Format a string of form ``{<field_name>#<conversion_function>}``
150
150
 
151
151
  The currently understood converters are:
152
- - ``datetime_to_timestamp_milliseconds``: converts a utc date string to a timestamp in
153
- milliseconds
154
- - ``to_rounded_wkt``: simplify the WKT of a geometry
155
- - ``to_bounds_lists``: convert to list(s) of bounds
156
- - ``to_nwse_bounds``: convert to North,West,South,East bounds
157
- - ``to_nwse_bounds_str``: convert to North,West,South,East bounds string with given separator
158
- - ``to_geojson``: convert to a GeoJSON (via __geo_interface__ if exists)
152
+ - ``ceda_collection_name``: generate a CEDA collection name from a string
153
+ - ``csv_list``: convert to a comma separated list
154
+ - ``datetime_to_timestamp_milliseconds``: converts a utc date string to a timestamp in milliseconds
155
+ - ``dict_filter_and_sub``: filter dict items using jsonpath and then apply recursive_sub_str
156
+ - ``fake_l2a_title_from_l1c``: used to generate SAFE format metadata for data from AWS
157
+ - ``from_alternate``: update assets using given alternate
159
158
  - ``from_ewkt``: convert EWKT to shapely geometry / WKT in DEFAULT_PROJ
160
- - ``to_ewkt``: convert to EWKT (Extended Well-Known text)
161
159
  - ``from_georss``: convert GeoRSS to shapely geometry / WKT in DEFAULT_PROJ
162
- - ``csv_list``: convert to a comma separated list
163
- - ``to_iso_utc_datetime_from_milliseconds``: convert a utc timestamp in given
164
- milliseconds to a utc iso datetime
165
- - ``to_iso_utc_datetime``: convert a UTC datetime string to ISO UTC datetime
166
- string
167
- - ``to_iso_date``: remove the time part of a iso datetime string
168
- - ``remove_extension``: on a string that contains dots, only take the first
169
- part of the list obtained by splitting the string on dots
160
+ - ``get_ecmwf_time``: get the time of a datetime string in the ECMWF format
170
161
  - ``get_group_name``: get the matching regex group name
162
+ - ``recursive_sub_str``: recursively substitue in the structure (e.g. dict) values matching a regex
163
+ - ``remove_extension``: on a string that contains dots, only take the first part of the list obtained by
164
+ splitting the string on dots
171
165
  - ``replace_str``: execute "string".replace(old, new)
172
- - ``recursive_sub_str``: recursively substitue in the structure (e.g. dict)
173
- values matching a regex
174
- - ``slice_str``: slice a string (equivalent to s[start, end, step])
175
- - ``to_lower``: Convert a string to lowercase
176
- - ``to_upper``: Convert a string to uppercase
177
- - ``to_title``: Convert a string to title case
178
- - ``fake_l2a_title_from_l1c``: used to generate SAFE format metadata for data from AWS
179
166
  - ``s2msil2a_title_to_aws_productinfo``: used to generate SAFE format metadata for data from AWS
167
+ - ``sanitize``: sanitize string
168
+ - ``slice_str``: slice a string (equivalent to s[start, end, step])
180
169
  - ``split_cop_dem_id``: get the bbox by splitting the product id
181
170
  - ``split_corine_id``: get the product type by splitting the product id
171
+ - ``to_bounds_lists``: convert to list(s) of bounds
182
172
  - ``to_datetime_dict``: convert a datetime string to a dictionary where values are either a string or a list
183
- - ``get_ecmwf_time``: get the time of a datetime string in the ECMWF format
184
- - ``sanitize``: sanitize string
185
- - ``ceda_collection_name``: generate a CEDA collection name from a string
186
- - ``convert_dict_filter_and_sub``: filter dict items using jsonpath and then apply recursive_sub_str
187
- - ``convert_from_alternate``: update assets using given alternate
173
+ - ``to_ewkt``: convert to EWKT (Extended Well-Known text)
174
+ - ``to_geojson``: convert to a GeoJSON (via __geo_interface__ if exists)
175
+ - ``to_iso_date``: remove the time part of a iso datetime string
176
+ - ``to_iso_utc_datetime_from_milliseconds``: convert a utc timestamp in given milliseconds to a utc iso datetime
177
+ - ``to_iso_utc_datetime``: convert a UTC datetime string to ISO UTC datetime string
178
+ - ``to_lower``: Convert a string to lowercase
179
+ - ``to_nwse_bounds_str``: convert to North,West,South,East bounds string with given separator
180
+ - ``to_nwse_bounds``: convert to North,West,South,East bounds
181
+ - ``to_rounded_wkt``: simplify the WKT of a geometry
182
+ - ``to_title``: Convert a string to title case
183
+ - ``to_upper``: Convert a string to uppercase
188
184
 
189
185
  :param search_param: The string to be formatted
190
186
  :param args: (optional) Additional arguments to use in the formatting process
@@ -490,9 +486,9 @@ def format_metadata(search_param: str, *args: Any, **kwargs: Any) -> str:
490
486
  return {"lon": lon, "lat": lat}
491
487
 
492
488
  @staticmethod
493
- def convert_csv_list(values_list: Any) -> Any:
489
+ def convert_csv_list(values_list: Any, separator=",") -> Any:
494
490
  if isinstance(values_list, list):
495
- return ",".join([str(x) for x in values_list])
491
+ return separator.join([str(x) for x in values_list])
496
492
  else:
497
493
  return values_list
498
494
 
@@ -106,9 +106,12 @@ class AwsAuth(Authentication):
106
106
  def _create_s3_session_from_credentials(self) -> boto3.Session:
107
107
  credentials = getattr(self.config, "credentials", {}) or {}
108
108
  if "aws_profile" in credentials:
109
+ logger.debug("Authentication using AWS profile")
109
110
  return create_s3_session(profile_name=credentials["aws_profile"])
110
111
  # auth using aws keys
111
- elif credentials:
112
+ elif credentials.get("aws_access_key_id") and credentials.get(
113
+ "aws_secret_access_key"
114
+ ):
112
115
  s3_session_kwargs: S3SessionKwargs = {
113
116
  "aws_access_key_id": credentials["aws_access_key_id"],
114
117
  "aws_secret_access_key": credentials["aws_secret_access_key"],
@@ -120,6 +123,7 @@ class AwsAuth(Authentication):
120
123
  return create_s3_session(**s3_session_kwargs)
121
124
  else:
122
125
  # auth using env variables or ~/.aws
126
+ logger.debug("Authentication using AWS environment")
123
127
  return create_s3_session()
124
128
 
125
129
  def _create_s3_resource(self) -> S3ServiceResource:
@@ -133,6 +137,9 @@ class AwsAuth(Authentication):
133
137
  endpoint_url=endpoint_url,
134
138
  )
135
139
  # could not auth using credentials: use no-sign-request strategy
140
+ logger.debug(
141
+ "Authentication using AWS no-sign-request strategy (no credentials found)"
142
+ )
136
143
  s3_resource = boto3.resource(service_name="s3", endpoint_url=endpoint_url)
137
144
  s3_resource.meta.client.meta.events.register(
138
145
  "choose-signer.s3.*", disable_signing