eodag 3.0.0b1__py3-none-any.whl → 3.0.0b2__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.
eodag/utils/repr.py ADDED
@@ -0,0 +1,113 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024, CS GROUP - France, https://www.csgroup.eu/
3
+ #
4
+ # This file is part of EODAG project
5
+ # https://www.github.com/CS-SI/EODAG
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ from __future__ import annotations
19
+
20
+ import collections.abc
21
+ from typing import Any, Optional
22
+ from urllib.parse import urlparse
23
+
24
+
25
+ def str_as_href(link: str) -> str:
26
+ """URL to html link"""
27
+ if urlparse(link).scheme in ("file", "http", "https", "s3"):
28
+ return f"<a href='{link}' target='_blank'>{link}</a>"
29
+ else:
30
+ return link
31
+
32
+
33
+ def html_table(input: Any, depth: Optional[int] = None) -> str:
34
+ """Transform input to HTML table"""
35
+ if isinstance(input, collections.abc.Mapping):
36
+ return dict_to_html_table(input, depth=depth)
37
+ elif isinstance(input, collections.abc.Sequence) and not isinstance(input, str):
38
+ return list_to_html_table(input, depth=depth)
39
+ elif isinstance(input, str):
40
+ return f"'{str_as_href(input)}'"
41
+ else:
42
+ return str_as_href(str(input))
43
+
44
+
45
+ def dict_to_html_table(
46
+ input_dict: collections.abc.Mapping,
47
+ depth: Optional[int] = None,
48
+ brackets: bool = True,
49
+ ) -> str:
50
+ """Transform input dict to HTML table"""
51
+ opening_bracket = "<span style='color: grey;'>{</span>" if brackets else ""
52
+ closing_bracket = "<span style='color: grey;'>}</span>" if brackets else ""
53
+ indent = "10px" if brackets else "0"
54
+
55
+ if depth is not None:
56
+ depth -= 1
57
+
58
+ if depth is None or depth >= 0:
59
+ return (
60
+ f"{opening_bracket}<table style='margin: 0;'>"
61
+ + "".join(
62
+ [
63
+ f"""<tr style='background-color: transparent;'>
64
+ <td style='padding: 5px 0 0 {indent}; text-align: left; color: grey; vertical-align:top;'>{k}:</td>
65
+ <td style='padding: 5px 0 0 10px; text-align: left;'>{
66
+ html_table(v, depth=depth)
67
+ },</td>
68
+ </tr>
69
+ """
70
+ for k, v in input_dict.items()
71
+ ]
72
+ )
73
+ + f"</table>{closing_bracket}"
74
+ )
75
+ else:
76
+ return (
77
+ f"{opening_bracket}"
78
+ + ", ".join(
79
+ [
80
+ f"""<span style='text-align: left;'>
81
+ '{k}': {html_table(v, depth=depth)}
82
+ </span>"""
83
+ for k, v in input_dict.items()
84
+ ]
85
+ )
86
+ + f"{closing_bracket}"
87
+ )
88
+
89
+
90
+ def list_to_html_table(
91
+ input_list: collections.abc.Sequence, depth: Optional[int] = None
92
+ ) -> str:
93
+ """Transform input list to HTML table"""
94
+ if depth is not None:
95
+ depth -= 1
96
+ separator = (
97
+ ",<br />"
98
+ if any(isinstance(v, collections.abc.Mapping) for v in input_list)
99
+ else ", "
100
+ )
101
+ return (
102
+ "<span style='color: grey;'>[</span>"
103
+ + separator.join(
104
+ [
105
+ f"""<span style='text-align: left;'>{
106
+ html_table(v, depth=depth)
107
+ }</span>
108
+ """
109
+ for v in input_list
110
+ ]
111
+ )
112
+ + "<span style='color: grey;'>]</span>"
113
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eodag
3
- Version: 3.0.0b1
3
+ Version: 3.0.0b2
4
4
  Summary: Earth Observation Data Access Gateway
5
5
  Home-page: https://github.com/CS-SI/eodag
6
6
  Author: CS GROUP - France
@@ -86,6 +86,7 @@ Requires-Dist: eodag[all] ; extra == 'docs'
86
86
  Requires-Dist: sphinx ; extra == 'docs'
87
87
  Requires-Dist: sphinx-book-theme ; extra == 'docs'
88
88
  Requires-Dist: sphinx-copybutton ; extra == 'docs'
89
+ Requires-Dist: sphinx-tabs ; extra == 'docs'
89
90
  Requires-Dist: nbsphinx ; extra == 'docs'
90
91
  Provides-Extra: ecmwf
91
92
  Requires-Dist: ecmwf-api-client ; extra == 'ecmwf'
@@ -297,7 +298,7 @@ An eodag instance can be exposed through a STAC compliant REST api from the comm
297
298
 
298
299
  .. code-block:: bash
299
300
 
300
- docker run -p 5000:5000 --rm csspace/eodag-server:3.0.0b1
301
+ docker run -p 5000:5000 --rm csspace/eodag-server:3.0.0b2
301
302
 
302
303
  You can also browse over your STAC API server using `STAC Browser <https://github.com/radiantearth/stac-browser>`_.
303
304
  Simply run:
@@ -4,17 +4,17 @@ eodag/config.py,sha256=pBM-fxbSphzFyK2q9Yw8MBEYKC3K5X_W7LiliBThgZc,26994
4
4
  eodag/crunch.py,sha256=fLVAPGVPw31N_DrnFk4gkCpQZLMY8oBhK6NUSYmdr24,1099
5
5
  eodag/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  eodag/api/__init__.py,sha256=ytr30NUVmEtmJTsp3QCwkCIhS1nF6UlFCv0vmySHN7g,735
7
- eodag/api/core.py,sha256=uhRSfh_JHLQj8J4To0iiwtC4Hd5eeJ4PA7ufaNTy3DM,106890
8
- eodag/api/search_result.py,sha256=5inSDPZBdcP3-4pQIRLknpBUMqkH0EKa2DgQ6UPpZu4,7074
7
+ eodag/api/core.py,sha256=w57S2sQ2INT1t-3_WWkkgpmzxSgAr34Vx_EtzMZ1LcA,106980
8
+ eodag/api/search_result.py,sha256=8_iZOJQF4x1uXq6IAegUnp5hxArqq9ylu1orJO2lrsc,8043
9
9
  eodag/api/product/__init__.py,sha256=1PjvzrIDj22xHX67vzUt9WuAvO2CACku5xKaIx2ivuQ,994
10
- eodag/api/product/_assets.py,sha256=3C_8DNAhgCF8eahjD8jTfqJ4IBZtk1Wx7uyuOtoznRA,4780
11
- eodag/api/product/_product.py,sha256=TDRqP9dtjlgJc3fx6dum689AF6GQCg7k6ECmARD_2UY,21226
10
+ eodag/api/product/_assets.py,sha256=fnucgOPT9D5NzFhKceiW7kBW-hcuZrOMjwXK6v57W6k,6663
11
+ eodag/api/product/_product.py,sha256=89Wkufl2ZjeiMLoOgUyloFW3cf_lIDfqOFjqssv4-lg,23570
12
12
  eodag/api/product/metadata_mapping.py,sha256=AysipreYzax47iHR2e4C_6ZFh9KnhfNhi6uicOYpdEs,70755
13
13
  eodag/api/product/drivers/__init__.py,sha256=mURgF0RpptZec5DIoCryNW4N_41g1Lao4BitMZ0dWZw,912
14
14
  eodag/api/product/drivers/base.py,sha256=LObZ7LSJo7B5UGtRX9RjCJKle2rslAtSlwAjc__FpUU,1910
15
15
  eodag/plugins/__init__.py,sha256=KQkD5aVwb9I6C-Rmi5ABEG1-j8w5FP1zKN12vagsT9Y,739
16
16
  eodag/plugins/base.py,sha256=I-kxG83mh805kZldrgl--VTVBzDNtyE8f_MRkm1VLCY,2689
17
- eodag/plugins/manager.py,sha256=BhdcR-xWm12anitv9I83vWvCHVbH1hB9gIFgIV6hnq4,15420
17
+ eodag/plugins/manager.py,sha256=h0TAM545suuwxOOp3_ysvdJEVJRz2P7V-5QSZAxbW1M,15480
18
18
  eodag/plugins/apis/__init__.py,sha256=PyY4f7P2iu3MkLPnw5eOrVew2fuavbBL3Asci3Ulwoo,744
19
19
  eodag/plugins/apis/base.py,sha256=MMGoyeRw72cS5EkRVmHsSpyh5BcPsL1EmzjKKG7zwMA,2669
20
20
  eodag/plugins/apis/ecmwf.py,sha256=rZaQSKelB-MPsGNixK9T52-kLK0zxh2ZZMluPdsWP_I,10007
@@ -53,7 +53,7 @@ eodag/plugins/search/csw.py,sha256=qZkjd_HtZwmCSOqeCEgJUJ9GEgfKks0VmwRi12zjrQU,9
53
53
  eodag/plugins/search/data_request_search.py,sha256=w7rykBm-ZBC24nKD4RFWQKw_rQWvwCffrQbteUJZN04,18619
54
54
  eodag/plugins/search/qssearch.py,sha256=Ljn_hxag3PE8CQCDAhdCalMVe_W0ccIh4ZM0LsLEPLY,72473
55
55
  eodag/plugins/search/static_stac_search.py,sha256=9dbX_Nw-R6VpeRNctgFyuuNCS0892Wj58rvvKE2MiEE,8691
56
- eodag/resources/ext_product_types.json,sha256=ZJu2xn6mqdOC6bwV5p4OAT4JetVwvYu1mp4FygI37hM,1540417
56
+ eodag/resources/ext_product_types.json,sha256=EfOhi4Dub-sP_i4unfiUH1RZ7ACy4NDM54FitL4AhtU,1550087
57
57
  eodag/resources/locations_conf_template.yml,sha256=_eBv-QKHYMIKhY0b0kp4Ee33RsayxN8LWH3kDXxfFSk,986
58
58
  eodag/resources/product_types.yml,sha256=L8N9vRaylB3VlQSE7dmtCB9ARu8tCpeWsKcAfCcGkN4,362918
59
59
  eodag/resources/providers.yml,sha256=YwJF4qRxr33C_IfBD-S0zk2eyL3ZX_SuTXvNnhm-3uI,255877
@@ -98,12 +98,13 @@ eodag/utils/exceptions.py,sha256=B4OYQD8yZfgS6HK4h-o-uTK0zDlIWzQXUGuvxJZHTSE,356
98
98
  eodag/utils/import_system.py,sha256=D6VqgkfcQFVfz82aJYILOMRIsY-fM5xcTAcBohyDpuc,4020
99
99
  eodag/utils/logging.py,sha256=YcgiOb8iUzMGGoW_ppuZm77bKi96MpDyMANBvu0Bu4k,5143
100
100
  eodag/utils/notebook.py,sha256=QkN9a6E9oinkUaBXeze0iYKusgqbMvV680dMrfm69Ao,2621
101
+ eodag/utils/repr.py,sha256=6ocR8WyatAvh0oAM40bj_FvIt_XMmu-sW0nPxbH9UnM,3683
101
102
  eodag/utils/requests.py,sha256=Uy7CdkllPtVLRQ-GiZe4cOmLfUAEp8cyzPGVoXhE95g,4914
102
103
  eodag/utils/rest.py,sha256=K5aVbbWOKHx7ncyvsDSJVgSOt9H8QW3bwaRQGdz9_B0,3491
103
104
  eodag/utils/stac_reader.py,sha256=QPRK10fnJE5MHlcNmHqv2Wugu_a8y5Z3jBAd2zKuLBI,9507
104
- eodag-3.0.0b1.dist-info/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
105
- eodag-3.0.0b1.dist-info/METADATA,sha256=is08JoxE0dpc-SrWYZNlwbvWPNwDzIb3kocipvIdi24,15036
106
- eodag-3.0.0b1.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
107
- eodag-3.0.0b1.dist-info/entry_points.txt,sha256=XKlXM_KuExc_-smc9Gf5MptkNkb-zFgz7bOX9kU7d8Y,2340
108
- eodag-3.0.0b1.dist-info/top_level.txt,sha256=025IMTmVe5eDjIPP4KEFQKespOPMQdne4U4jOy8nftM,6
109
- eodag-3.0.0b1.dist-info/RECORD,,
105
+ eodag-3.0.0b2.dist-info/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
106
+ eodag-3.0.0b2.dist-info/METADATA,sha256=iURP2bGJkxeYDuhuLQ2Bg7jmFyVzgmn7lTUj6ZpB9-0,15081
107
+ eodag-3.0.0b2.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
108
+ eodag-3.0.0b2.dist-info/entry_points.txt,sha256=XKlXM_KuExc_-smc9Gf5MptkNkb-zFgz7bOX9kU7d8Y,2340
109
+ eodag-3.0.0b2.dist-info/top_level.txt,sha256=025IMTmVe5eDjIPP4KEFQKespOPMQdne4U4jOy8nftM,6
110
+ eodag-3.0.0b2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (70.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5