eodash_catalog 0.0.3__py3-none-any.whl → 0.0.5__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.

Potentially problematic release.


This version of eodash_catalog might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Daniel Santillan <daniel.santillan@eox.at>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.3"
4
+ __version__ = "0.0.5"
@@ -93,12 +93,19 @@ def process_catalog_file(file_path, options):
93
93
  process_indicator_file(config, file_path, catalog, options)
94
94
  else:
95
95
  # if not try to see if indicator definition available
96
- process_indicator_file(
97
- config,
98
- "%s/%s.yaml" % (options.indicatorspath, collection),
99
- catalog,
100
- options,
101
- )
96
+ file_path = "%s/%s.yaml" % (options.indicatorspath, collection)
97
+ if os.path.isfile(file_path):
98
+ process_indicator_file(
99
+ config,
100
+ "%s/%s.yaml" % (options.indicatorspath, collection),
101
+ catalog,
102
+ options,
103
+ )
104
+ else:
105
+ print(
106
+ "Warning: neither collection nor indicator found for %s"
107
+ % collection
108
+ )
102
109
 
103
110
  strategy = TemplateLayoutStrategy(item_template="${collection}/${year}")
104
111
  catalog.normalize_hrefs(
@@ -249,7 +256,8 @@ def process_collection_file(config, file_path, catalog, options):
249
256
  countries.append(sub_coll_def["Country"])
250
257
  process_collection_file(
251
258
  config,
252
- "../collections/%s.yaml" % (sub_coll_def["Collection"]),
259
+ "%s/%s.yaml"
260
+ % (options.collectionspath, sub_coll_def["Collection"]),
253
261
  parent_collection,
254
262
  options,
255
263
  )
@@ -281,7 +289,8 @@ def process_collection_file(config, file_path, catalog, options):
281
289
  )
282
290
  process_collection_file(
283
291
  config,
284
- "../collections/%s.yaml" % (sub_coll_def["Collection"]),
292
+ "%s/%s.yaml"
293
+ % (options.collectionspath, sub_coll_def["Collection"]),
285
294
  tmp_catalog,
286
295
  options,
287
296
  )
@@ -1477,29 +1486,35 @@ class Options:
1477
1486
 
1478
1487
 
1479
1488
  @click.command()
1489
+ @click.option(
1490
+ "--catalog",
1491
+ "-ctl",
1492
+ help="id of catalog configuration file to be used",
1493
+ default=None,
1494
+ )
1480
1495
  @click.option(
1481
1496
  "--catalogspath",
1482
1497
  "-ctp",
1483
1498
  help="path to catalog configuration files",
1484
- default="./catalogs/",
1499
+ default="catalogs",
1485
1500
  )
1486
1501
  @click.option(
1487
1502
  "--collectionspath",
1488
1503
  "-clp",
1489
1504
  help="path to collection configuration files",
1490
- default="./collections/",
1505
+ default="collections",
1491
1506
  )
1492
1507
  @click.option(
1493
1508
  "--indicatorspath",
1494
1509
  "-inp",
1495
- help="path to indicaotr configuration files",
1496
- default="./indicators/",
1510
+ help="path to indicator configuration files",
1511
+ default="indicators",
1497
1512
  )
1498
1513
  @click.option(
1499
1514
  "--outputpath",
1500
1515
  "-o",
1501
1516
  help="path where the generated catalogs will be saved",
1502
- default="./build/",
1517
+ default="build",
1503
1518
  )
1504
1519
  @click.option(
1505
1520
  "-vd",
@@ -1519,7 +1534,15 @@ class Options:
1519
1534
  nargs=-1,
1520
1535
  )
1521
1536
  def process_catalogs(
1522
- catalogspath, collectionspath, indicatorspath, outputpath, vd, ni, tn, collections
1537
+ catalog,
1538
+ catalogspath,
1539
+ collectionspath,
1540
+ indicatorspath,
1541
+ outputpath,
1542
+ vd,
1543
+ ni,
1544
+ tn,
1545
+ collections,
1523
1546
  ):
1524
1547
  """STAC generator and harvester:
1525
1548
  This library goes over configured endpoints extracting as much information
@@ -1538,9 +1561,12 @@ def process_catalogs(
1538
1561
  for file_name in os.listdir(catalogspath):
1539
1562
  file_path = os.path.join(catalogspath, file_name)
1540
1563
  if os.path.isfile(file_path):
1541
- tasks.append(
1542
- RaisingThread(target=process_catalog_file, args=(file_path, options))
1543
- )
1544
- tasks[-1].start()
1564
+ if catalog == None or os.path.splitext(file_name)[0] == catalog:
1565
+ tasks.append(
1566
+ RaisingThread(
1567
+ target=process_catalog_file, args=(file_path, options)
1568
+ )
1569
+ )
1570
+ tasks[-1].start()
1545
1571
  for task in tasks:
1546
1572
  task.join()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eodash_catalog
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: This package is intended to help create a compatible STAC catalog for the eodash dashboard client. It supports configuration of multiple endpoint types for information extraction.
5
5
  Project-URL: Documentation, https://github.com/eodash/eodash_catalog#readme
6
6
  Project-URL: Issues, https://github.com/eodash/eodash_catalog/issues
@@ -0,0 +1,11 @@
1
+ eodash_catalog/__about__.py,sha256=ZfDJZXDGJEGGrB1wiMfBDZ5ZIVlRCJpUhvHXTANnD88,137
2
+ eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
3
+ eodash_catalog/duration.py,sha256=6rxALD9MZS6rTE1AZgvjrABr7zwg8S-kLc_w9BltvY0,11007
4
+ eodash_catalog/generate_indicators.py,sha256=Pdl4a4AZ2rDgyA1paTC_yfM7zQW5n68s2u1xdvFPNzY,60144
5
+ eodash_catalog/sh_endpoint.py,sha256=KyZGmVrjZOCIuJizmYSy8VSWrfqqn2r-Ggh_8Q-s2vI,581
6
+ eodash_catalog/utils.py,sha256=NbwqHE5Qhd3Fke_fbl3HY803qSKJJKP1atTNrGPO7KY,6097
7
+ eodash_catalog-0.0.5.dist-info/METADATA,sha256=n63xtKFZPqXCnPKLjStUExSCTn7VCR7FAlqVnxJaIDU,2156
8
+ eodash_catalog-0.0.5.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
9
+ eodash_catalog-0.0.5.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
10
+ eodash_catalog-0.0.5.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
11
+ eodash_catalog-0.0.5.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- eodash_catalog/__about__.py,sha256=XwGUn_fck5BM1feQDYsxZXExk2qm1bl87CumqjZGi90,137
2
- eodash_catalog/__init__.py,sha256=_W_9emPYf6FUqc0P8L2SmADx6hGSd7PlQV3yRmCk5uM,115
3
- eodash_catalog/duration.py,sha256=6rxALD9MZS6rTE1AZgvjrABr7zwg8S-kLc_w9BltvY0,11007
4
- eodash_catalog/generate_indicators.py,sha256=oRZEITNeClFA3xiI-OJrTqC0eeUCCi3mhzY83i9IIN0,59442
5
- eodash_catalog/sh_endpoint.py,sha256=KyZGmVrjZOCIuJizmYSy8VSWrfqqn2r-Ggh_8Q-s2vI,581
6
- eodash_catalog/utils.py,sha256=NbwqHE5Qhd3Fke_fbl3HY803qSKJJKP1atTNrGPO7KY,6097
7
- eodash_catalog-0.0.3.dist-info/METADATA,sha256=6rH58-poXqU6Z9-6l1SDKaNFFvm-OhxdKoqaXSKyiEg,2156
8
- eodash_catalog-0.0.3.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
9
- eodash_catalog-0.0.3.dist-info/entry_points.txt,sha256=kuUQrDG1PtYd8kPjf5XM6H_NtQd9Ozwl0jjiGtAvZSM,87
10
- eodash_catalog-0.0.3.dist-info/licenses/LICENSE.txt,sha256=oJCW5zQxnFD-J0hGz6Zh5Lkpdk1oAndmWhseTmV224E,1107
11
- eodash_catalog-0.0.3.dist-info/RECORD,,