dafab-client 3.2.0__tar.gz → 3.2.1__tar.gz

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 dafab-client might be problematic. Click here for more details.

Files changed (142) hide show
  1. dafab_client-3.2.1/LICENSE +202 -0
  2. dafab_client-3.2.1/PKG-INFO +219 -0
  3. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_notebooks/dafab_simple_user_workflows.ipynb +1 -1
  4. dafab_client-3.2.1/dafab_client.egg-info/PKG-INFO +219 -0
  5. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client.egg-info/SOURCES.txt +1 -0
  6. {dafab_client-3.2.0 → dafab_client-3.2.1}/pyproject.toml +14 -2
  7. dafab_client-3.2.1/readme.md +189 -0
  8. dafab_client-3.2.0/PKG-INFO +0 -151
  9. dafab_client-3.2.0/dafab_client.egg-info/PKG-INFO +0 -151
  10. dafab_client-3.2.0/readme.md +0 -132
  11. {dafab_client-3.2.0 → dafab_client-3.2.1}/MANIFEST.in +0 -0
  12. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/__init__.py +0 -0
  13. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/__init__.py +0 -0
  14. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/__init__.py +0 -0
  15. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/accountclient.py +0 -0
  16. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/baseclient.py +0 -0
  17. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/client.py +0 -0
  18. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/credentialclient.py +0 -0
  19. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/didclient.py +0 -0
  20. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/downloadclient.py +0 -0
  21. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/pingclient.py +0 -0
  22. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/replicaclient.py +0 -0
  23. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/rseclient.py +0 -0
  24. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/scopeclient.py +0 -0
  25. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/client/uploadclient.py +0 -0
  26. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/cache.py +0 -0
  27. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/checksum.py +0 -0
  28. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/client.py +0 -0
  29. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/config.py +0 -0
  30. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/constants.py +0 -0
  31. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/constraints.py +0 -0
  32. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/didtype.py +0 -0
  33. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/exception.py +0 -0
  34. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/extra.py +0 -0
  35. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/filter.py +0 -0
  36. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/logging.py +0 -0
  37. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/pcache.py +0 -0
  38. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/plugins.py +0 -0
  39. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/types.py +0 -0
  40. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/common/utils.py +0 -0
  41. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/core/rse.py +0 -0
  42. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/dafab_lib.py +0 -0
  43. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/global_utils.py +0 -0
  44. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/overridden_rucio_client.py +0 -0
  45. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/__init__.py +0 -0
  46. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/protocols/__init__.py +0 -0
  47. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/protocols/gfal.py +0 -0
  48. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/protocols/protocol.py +0 -0
  49. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/protocols/webdav.py +0 -0
  50. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/rsemanager.py +0 -0
  51. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/rse/translation.py +0 -0
  52. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/secrets/user_dafab/config +0 -0
  53. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/secrets/user_dafab/rucio_ca_bundle.pem +0 -0
  54. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/_rucio/version.py +0 -0
  55. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/assets/smart_agriculture/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115/field-boundaries-S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115-10-v3.0.0-overview.png +0 -0
  56. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/assets/smart_agriculture/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115/field-boundaries-S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115-10-v3.0.0-preview.json +0 -0
  57. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/assets/smart_agriculture/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115/field-boundaries-S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115-10-v3.0.0-thumbnail.png +0 -0
  58. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/assets/smart_agriculture/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115/field-boundaries-S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115-10-v3.0.0.geojson +0 -0
  59. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/smart_agriculture/agriculture_season/agriculture_season_(bootstrap).json +0 -0
  60. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/smart_agriculture/agriculture_season/agriculture_season_autumn_(bootstrap).json +0 -0
  61. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/smart_agriculture/agriculture_season/agriculture_season_spring_(bootstrap).json +0 -0
  62. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/smart_agriculture/agriculture_season/agriculture_season_summer_(bootstrap).json +0 -0
  63. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/smart_agriculture/agriculture_season/agriculture_season_winter_(bootstrap).json +0 -0
  64. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/smart_agriculture/agriculture_season/agriculture_season_winter_(example).json +0 -0
  65. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_anomaly/water_anomaly_(bootstrap).json +0 -0
  66. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_anomaly/water_anomaly_drought_(bootstrap).json +0 -0
  67. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_anomaly/water_anomaly_flood_(bootstrap).json +0 -0
  68. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_anomaly/water_anomaly_normal_(bootstrap).json +0 -0
  69. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_basin/water_basin_(bootstrap).json +0 -0
  70. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_basin/water_basin_ganges_(bootstrap).json +0 -0
  71. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/catalogs/water_analysis/water_basin/water_basin_unclassified_(bootstrap).json +0 -0
  72. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/collections/sentinel_2_l2a/sentinel_2_l2a_(bootstrap).json +0 -0
  73. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/collections/smart_agriculture/smart_agriculture_(bootstrap).json +0 -0
  74. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/collections/water_analysis/water_analysis_(bootstrap).json +0 -0
  75. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115.json +0 -0
  76. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_B02_10m.jp2 +0 -0
  77. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_B03_10m.jp2 +0 -0
  78. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_B04_10m.jp2 +0 -0
  79. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_B08_10m.jp2 +0 -0
  80. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_SCL_20m.jp2 +0 -0
  81. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/dasi/staged/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_TCI_20m.jp2 +0 -0
  82. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/items/smart_agriculture/S2B_MSIL2A_20190101T091359_N0500_R050_T34SGH_20221202T002115_smart_agriculture_300_(bootstrap).json +0 -0
  83. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_data/notebook_fixtures/stac_(bootstrap).json +0 -0
  84. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_notebooks/dafab_dasi_workflows.ipynb +0 -0
  85. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_notebooks/dafab_operator_workflows.ipynb +0 -0
  86. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/example_notebooks/dafab_skim_workflows.ipynb +0 -0
  87. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/System/check_available_accounts.py +0 -0
  88. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/System/check_storage.py +0 -0
  89. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/__init__.py +0 -0
  90. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/check_server_health.py +0 -0
  91. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/container_management/ensure_container.py +0 -0
  92. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/container_management/list_containers.py +0 -0
  93. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/dataset_management/ensure_dataset.py +0 -0
  94. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/dataset_management/list_datasets.py +0 -0
  95. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/dataset_management/scope_management.py +0 -0
  96. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/db_bootstrap/account_manager.py +0 -0
  97. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/demo_imports.py +0 -0
  98. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/did_management/operations.py +0 -0
  99. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Deletion/delete_file_of_scope_name.py +0 -0
  100. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Deletion/delete_replica_of_scope_name.py +0 -0
  101. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Insertion/upload_file_of_scope_name.py +0 -0
  102. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Retrieval/download_file_of_scope_name.py +0 -0
  103. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Workflows/manage_derived_assets.py +0 -0
  104. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Workflows/manage_original_assets.py +0 -0
  105. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/Workflows/original_previews.py +0 -0
  106. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/file_management/list_files.py +0 -0
  107. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/D3.2 Rucio current implementation of enhanced filtering.md +0 -0
  108. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/filter_by_bbox.py +0 -0
  109. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/filter_by_bbox_and_timerange.py +0 -0
  110. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/filter_by_enhanced_filter.py +0 -0
  111. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/filter_by_relationships.py +0 -0
  112. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/filter_by_stac_type.py +0 -0
  113. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/filter_by_timerange.py +0 -0
  114. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/filtering/mapper.py +0 -0
  115. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Insertion/set_metadata.py +0 -0
  116. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Operations/common.py +0 -0
  117. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Operations/delete_metadata_for_did.py +0 -0
  118. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Operations/insert_metadata_for_did.py +0 -0
  119. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Operations/update_metadata_for_did.py +0 -0
  120. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Operations/upsert_metadata_for_did.py +0 -0
  121. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Patch/patch_metadata_for_dids.py +0 -0
  122. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Preflight/validate_derived_item_file.py +0 -0
  123. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Preflight/validate_facet_value_catalog_file.py +0 -0
  124. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Preflight/validate_original_item_file.py +0 -0
  125. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Retrieval/Complete/get_metadata_for_scope_name.py +0 -0
  126. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Retrieval/Partial/get_single_metadata_for_scope_name.py +0 -0
  127. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Workflows/delete_derived_item.py +0 -0
  128. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Workflows/sync_spatial_bbox_integrity.py +0 -0
  129. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Workflows/update_derived_item.py +0 -0
  130. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/Workflows/update_original_item.py +0 -0
  131. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/metadata_management/document_api.py +0 -0
  132. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/resources/schemas/Schema_Copernicus_with_dafab.json +0 -0
  133. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/resources/schemas/Schema_DaFab_Facet_Value_Catalog.json +0 -0
  134. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/resources/schemas/dafab-smart_agriculture-item.schema.json +0 -0
  135. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/resources/schemas/dafab-water_analysis-item.schema.json +0 -0
  136. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/resources/schemas/dasi-original-item.schema.json +0 -0
  137. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client/helpers/runtime_paths.py +0 -0
  138. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client.egg-info/dependency_links.txt +0 -0
  139. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client.egg-info/requires.txt +0 -0
  140. {dafab_client-3.2.0 → dafab_client-3.2.1}/dafab_client.egg-info/top_level.txt +0 -0
  141. {dafab_client-3.2.0 → dafab_client-3.2.1}/docs/releasing.md +0 -0
  142. {dafab_client-3.2.0 → dafab_client-3.2.1}/setup.cfg +0 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: dafab_client
3
+ Version: 3.2.1
4
+ Summary: Python client for the DaFab catalogue of Sentinel-2 imagery and AI-derived water and agriculture products, built on Rucio.
5
+ Author: DaFab
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://www.dafab-ai.eu
8
+ Project-URL: Discovery site, https://dafab.cern.ch/discover/
9
+ Project-URL: STAC catalogue, https://dafab.cern.ch/stac
10
+ Project-URL: Repository, https://github.com/DaFab-AI-eu/dafab-client
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Topic :: Scientific/Engineering :: GIS
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: folium<1,>=0.20.0
21
+ Requires-Dist: jsonschema<5,>=4.26.0
22
+ Requires-Dist: packaging<27,>=26.1
23
+ Requires-Dist: requests<3,>=2.33.1
24
+ Requires-Dist: typing_extensions<5,>=4.15
25
+ Requires-Dist: urllib3<3,>=2.6.3
26
+ Provides-Extra: notebooks
27
+ Requires-Dist: ipykernel<7,>=6.30; extra == "notebooks"
28
+ Requires-Dist: jupyter<2,>=1.1; extra == "notebooks"
29
+ Dynamic: license-file
30
+
31
+ # DaFab Client
32
+
33
+ The Python client for the DaFab catalogue.
34
+
35
+ [DaFab](https://www.dafab-ai.eu) processes Copernicus Sentinel-2 imagery into AI-generated water-analysis and field-delineation products on European HPC systems, and publishes the images and the products as STAC items in a Rucio catalogue hosted at CERN. This client reads that catalogue, searches it with typed metadata filters, follows the lineage between a product and the image it was derived from, and downloads assets. It works out of the box with a shared read profile, no configuration needed.
36
+
37
+ You can also browse the same catalogue without code, on the [discovery site](https://dafab.cern.ch/discover/) or through its [STAC root](https://dafab.cern.ch/stac).
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install dafab-client
43
+ ```
44
+
45
+ Python 3.10 or newer. The client talks to `dafab.cern.ch` over HTTPS and downloads assets from the project's object store. For the notebook, install the `notebooks` extra described below.
46
+
47
+ ## First call
48
+
49
+ ```python
50
+ import dafab_client as dc
51
+
52
+ dc.ping() # the server version
53
+ dc.whoami() # the shared read profile, account user_dafab
54
+ ```
55
+
56
+ The package ships the profile `user_dafab`, meant for reading the public catalogue, together with the TLS trust bundle it uses. Publication needs a personal account, see the last section.
57
+
58
+ ## What the catalogue holds
59
+
60
+ Everything lives in the scope `dafab` as STAC 1.1 items, each stored as a Rucio container that carries its full JSON document.
61
+
62
+ | Collection | Content | Example item |
63
+ |---|---|---|
64
+ | `sentinel_2_l2a` | Sentinel-2 L2A source images | `S2A_MSIL2A_20160229T032652_N0500_R018_T48QUH_20231011T191655` |
65
+ | `water_analysis` | water maps, excess and deficit polygons, previews | the image id followed by `_water_analysis_300` |
66
+ | `smart_agriculture` | field boundaries and previews | the image id followed by `_smart_agriculture_300` |
67
+
68
+ A product carries a `derived_from` link to its source image, and the source image is attached to its products in the catalogue, so lineage can be followed both ways. Facet catalogues such as `agriculture_season`, `water_anomaly` and `water_basin` group products by season, by flood, drought or normal conditions, and by river basin. Auxiliary layers used by the processing live in their own scopes, `hand`, `worldcover` and `gfm`.
69
+
70
+ ```python
71
+ dc.list_stac_scopes() # the scopes visible to the profile
72
+ dc.get_catalogs_and_collections() # collections and facet catalogues, as {"scope", "id"} rows
73
+ dc.get_items(filters={"name": "S2A_MSIL2A_20160229T032652*"}, long=False) # item ids of one tile and date
74
+ ```
75
+
76
+ `get_items` returns every item without a filter, which is tens of thousands of ids and takes a few seconds. Narrow it with `name` patterns (`*` or `%` match any sequence) or use the searches below.
77
+
78
+ ## Search
79
+
80
+ Searches are JSON filters made of comparison nodes, each with a `path` into the document, a `comparator`, a `value` and a `valueType`, combined by logical nodes with `and`, `or` and `not`. The server evaluates them against the declared indexes.
81
+
82
+ ```python
83
+ clear_images_2016 = {
84
+ "type": "logical", "combinator": "and", "filters": [
85
+ {"type": "comparison", "comparator": "equals", "path": ["collection"], "value": "sentinel_2_l2a", "valueType": "string"},
86
+ {"type": "comparison", "comparator": "lessThanOrEqual", "path": ["properties", "eo:cloud_cover"], "value": 20, "valueType": "number"},
87
+ {"type": "comparison", "comparator": "greaterThanOrEqual", "path": ["properties", "datetime"], "value": "2016-01-01T00:00:00Z", "valueType": "date"},
88
+ {"type": "comparison", "comparator": "lessThan", "path": ["properties", "datetime"], "value": "2017-01-01T00:00:00Z", "valueType": "date"},
89
+ ],
90
+ }
91
+ ids = dc.get_items_by_enhanced_filter(clear_images_2016, return_mode="ids")
92
+ items = dc.get_items_by_enhanced_filter(clear_images_2016, return_mode="metadata") # full documents
93
+ ```
94
+
95
+ A group marked `"inherited": true` is evaluated against the ancestors of each candidate, so a search can select products by properties of their source image. This finds field-delineation products whose source image had at most 20 percent cloud cover.
96
+
97
+ ```python
98
+ fields_from_clear_images = {
99
+ "type": "logical", "combinator": "and", "filters": [
100
+ {"type": "comparison", "comparator": "equals", "path": ["collection"], "value": "smart_agriculture", "valueType": "string"},
101
+ {"type": "logical", "combinator": "and", "inherited": True, "filters": [
102
+ {"type": "comparison", "comparator": "equals", "path": ["collection"], "value": "sentinel_2_l2a", "valueType": "string"},
103
+ {"type": "comparison", "comparator": "lessThanOrEqual", "path": ["properties", "eo:cloud_cover"], "value": 20, "valueType": "number"},
104
+ ]},
105
+ ],
106
+ }
107
+ product_ids = dc.get_items_by_enhanced_filter(fields_from_clear_images)
108
+ ```
109
+
110
+ | Comparators | Meaning |
111
+ |---|---|
112
+ | `equals`, `notEquals` | equality, or inequality |
113
+ | `lessThan`, `lessThanOrEqual`, `greaterThan`, `greaterThanOrEqual` | ordered comparison of numbers, dates or strings |
114
+ | `in` | the value is one of a list |
115
+ | `like`, `notLike` | text pattern, `*` or `%` for any sequence and `?` for one character |
116
+ | `contains`, `containsAny`, `containsAll` | array membership |
117
+ | `isNull`, `isNotNull`, `isEmpty`, `isNotEmpty` | presence checks, pass `"value": null` |
118
+
119
+ Value types are `string`, `number`, `integer`, `boolean`, `date` and `array`. A document that lacks the field matches neither a typed comparison nor its negation, so incomplete metadata is left out rather than silently included.
120
+
121
+ Three helpers build the common spatial and temporal searches for you, and return ids or full documents with `return_mode`.
122
+
123
+ ```python
124
+ dc.get_items_by_timerange("2016-02-01T00:00:00Z", "2016-03-01T00:00:00Z")
125
+ dc.get_items_by_bbox(103.5, 19.8, 104.2, 20.8) # west, south, east, north
126
+ dc.get_items_by_bbox_and_timerange([103.5, 19.8, 104.2, 20.8], ["2016-02-01T00:00:00Z", "2016-03-01T00:00:00Z"])
127
+ ```
128
+
129
+ Lineage and facets have their own helpers.
130
+
131
+ ```python
132
+ image = "S2A_MSIL2A_20160229T032652_N0500_R018_T48QUH_20231011T191655"
133
+ product = image + "_smart_agriculture_300"
134
+
135
+ dc.get_source_original_item_ids_from_derived_item(product) # the image the product came from
136
+ dc.get_related_item_ids_from_original_item(image) # every product of the image
137
+ dc.get_sibling_derived_item_ids(image, collection_id="smart_agriculture")
138
+ dc.get_item_ids_by_top_facet_catalog("water_basin") # products placed under any river basin
139
+ dc.get_item_ids_by_facet_value_catalog("water_basin_mekong") # products in one basin
140
+ dc.get_item_facet_placements(product, collection_id="smart_agriculture")
141
+ ```
142
+
143
+ ## Read metadata
144
+
145
+ ```python
146
+ document = dc.get_bulk_metadata(product) # the whole STAC item
147
+ subset = dc.get_bulk_metadata(product, paths=["/collection", "/properties/datetime", "/assets"])
148
+ dc.extract_metadata_value("/properties/datetime", pname=image) # one value by JSON pointer
149
+ report = dc.list_item_asset_entries(product, check_storage=True) # every asset and whether its file is in storage
150
+ ```
151
+
152
+ `dc.as_json(document)` formats any of these for display.
153
+
154
+ ## Download assets
155
+
156
+ ```python
157
+ dc.download_item_asset(product, "dafab-field-boundaries-thumbnail", destination_dir="downloads")
158
+ href = dc.build_stable_asset_href(image, "TCI_20m") # the permanent URL of an asset
159
+ dc.download_asset_from_stable_href(href, destination_dir="downloads")
160
+ dc.download_all_derived_item_assets(product, destination_dir="downloads")
161
+ ```
162
+
163
+ Downloads go to `destination_dir`, the current directory by default, and refuse to replace an existing file unless `overwrite=True`. Where a local copy of the storage is mounted, `download_item_asset` uses it and reports `mode == "local_posix"`.
164
+
165
+ `dc.get_map(items, output_path="map.html")` renders the footprints of a list of documents to an interactive HTML map.
166
+
167
+ ## Notebook
168
+
169
+ The packaged notebook walks through all of the above against the live catalogue and runs unchanged with the shared profile. Its download cells write under `demo-data/` in the current directory.
170
+
171
+ ```bash
172
+ pip install "dafab-client[notebooks]"
173
+ python -c "import dafab_client as dc; print(dc.get_example('user'))"
174
+ jupyter notebook dafab_simple_user_workflows.ipynb
175
+ ```
176
+
177
+ ## Validate a document
178
+
179
+ The validators check an item against the schemas shipped with the client, either a local file or the stored copy on the server, without changing anything.
180
+
181
+ ```python
182
+ dc.validate_original_item(source="server", expected_item_id=image, expected_collection_id="sentinel_2_l2a")
183
+ dc.validate_derived_item(source="local", item_path="my_product.json")
184
+ ```
185
+
186
+ ## Configuration
187
+
188
+ Nothing is required for reading. These variables change the defaults.
189
+
190
+ | Variable | Effect |
191
+ |---|---|
192
+ | `DAFAB_PROFILE` | the account whose profile to load, default `user_dafab` |
193
+ | `DAFAB_PROFILE_PATH` | an explicit profile file |
194
+ | `DAFAB_PROFILE_DIR` | the directory holding `<account>/config`, default `~/.config/dafab/credentials/profiles` or `$XDG_CONFIG_HOME/dafab/credentials/profiles` |
195
+ | `DAFAB_DEMO_DATA_DIR` | where the notebook and `get_map` write, default `./demo-data` |
196
+
197
+ Set them before importing the client. A profile is a JSON file with the connection and the credentials of one account.
198
+
199
+ ```json
200
+ {
201
+ "rucio_host": "https://dafab.cern.ch",
202
+ "auth_host": "https://dafab.cern.ch",
203
+ "auth_type": "userpass",
204
+ "account": "my_account",
205
+ "creds": {"username": "my_account", "password": "..."},
206
+ "ca_cert": "$client_path/_rucio/secrets/user_dafab/rucio_ca_bundle.pem",
207
+ "vo": "def"
208
+ }
209
+ ```
210
+
211
+ `ca_cert` names the TLS trust bundle. `$client_path` is the installed package, `$client_account` the account name, and `$profile_path` the directory of the profile file, so a personal profile can reuse the shipped bundle as above. Keep profile files private.
212
+
213
+ ## Publishing
214
+
215
+ Publishing images and products, attaching them to their collections and facets, and repairing collection extents are done by DaFab's processing pipelines with the publication helpers of this package, `ensure_item`, `set_metadata`, `publish_original_asset`, `publish_derived_asset` and the `sync_*_collection_extent` family. They write to the catalogue and need an account with write access. Project members find the procedures in the repository's `docs/`. To request an account, contact the project through [dafab-ai.eu](https://www.dafab-ai.eu).
216
+
217
+ ## Licence
218
+
219
+ Apache License 2.0. The package bundles the Rucio client modules, which are also Apache 2.0.
@@ -82,7 +82,7 @@
82
82
  "DERIVED_ASSET_KEY = \"dafab-field-boundaries\"\n",
83
83
  "\n",
84
84
  "TOP_FACET_CATALOG_ID = \"water_basin\"\n",
85
- "FACET_VALUE_CATALOG_ID = \"water_basin_ganges\"\n",
85
+ "FACET_VALUE_CATALOG_ID = \"water_basin_mekong\"\n",
86
86
  "\n",
87
87
  "HAND_SCOPE = \"hand\"\n",
88
88
  "HAND_ITEM_ID = \"Copernicus_DSM_COG_10_N15_00_W018_00_HAND\"\n",
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: dafab_client
3
+ Version: 3.2.1
4
+ Summary: Python client for the DaFab catalogue of Sentinel-2 imagery and AI-derived water and agriculture products, built on Rucio.
5
+ Author: DaFab
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://www.dafab-ai.eu
8
+ Project-URL: Discovery site, https://dafab.cern.ch/discover/
9
+ Project-URL: STAC catalogue, https://dafab.cern.ch/stac
10
+ Project-URL: Repository, https://github.com/DaFab-AI-eu/dafab-client
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Topic :: Scientific/Engineering :: GIS
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: folium<1,>=0.20.0
21
+ Requires-Dist: jsonschema<5,>=4.26.0
22
+ Requires-Dist: packaging<27,>=26.1
23
+ Requires-Dist: requests<3,>=2.33.1
24
+ Requires-Dist: typing_extensions<5,>=4.15
25
+ Requires-Dist: urllib3<3,>=2.6.3
26
+ Provides-Extra: notebooks
27
+ Requires-Dist: ipykernel<7,>=6.30; extra == "notebooks"
28
+ Requires-Dist: jupyter<2,>=1.1; extra == "notebooks"
29
+ Dynamic: license-file
30
+
31
+ # DaFab Client
32
+
33
+ The Python client for the DaFab catalogue.
34
+
35
+ [DaFab](https://www.dafab-ai.eu) processes Copernicus Sentinel-2 imagery into AI-generated water-analysis and field-delineation products on European HPC systems, and publishes the images and the products as STAC items in a Rucio catalogue hosted at CERN. This client reads that catalogue, searches it with typed metadata filters, follows the lineage between a product and the image it was derived from, and downloads assets. It works out of the box with a shared read profile, no configuration needed.
36
+
37
+ You can also browse the same catalogue without code, on the [discovery site](https://dafab.cern.ch/discover/) or through its [STAC root](https://dafab.cern.ch/stac).
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install dafab-client
43
+ ```
44
+
45
+ Python 3.10 or newer. The client talks to `dafab.cern.ch` over HTTPS and downloads assets from the project's object store. For the notebook, install the `notebooks` extra described below.
46
+
47
+ ## First call
48
+
49
+ ```python
50
+ import dafab_client as dc
51
+
52
+ dc.ping() # the server version
53
+ dc.whoami() # the shared read profile, account user_dafab
54
+ ```
55
+
56
+ The package ships the profile `user_dafab`, meant for reading the public catalogue, together with the TLS trust bundle it uses. Publication needs a personal account, see the last section.
57
+
58
+ ## What the catalogue holds
59
+
60
+ Everything lives in the scope `dafab` as STAC 1.1 items, each stored as a Rucio container that carries its full JSON document.
61
+
62
+ | Collection | Content | Example item |
63
+ |---|---|---|
64
+ | `sentinel_2_l2a` | Sentinel-2 L2A source images | `S2A_MSIL2A_20160229T032652_N0500_R018_T48QUH_20231011T191655` |
65
+ | `water_analysis` | water maps, excess and deficit polygons, previews | the image id followed by `_water_analysis_300` |
66
+ | `smart_agriculture` | field boundaries and previews | the image id followed by `_smart_agriculture_300` |
67
+
68
+ A product carries a `derived_from` link to its source image, and the source image is attached to its products in the catalogue, so lineage can be followed both ways. Facet catalogues such as `agriculture_season`, `water_anomaly` and `water_basin` group products by season, by flood, drought or normal conditions, and by river basin. Auxiliary layers used by the processing live in their own scopes, `hand`, `worldcover` and `gfm`.
69
+
70
+ ```python
71
+ dc.list_stac_scopes() # the scopes visible to the profile
72
+ dc.get_catalogs_and_collections() # collections and facet catalogues, as {"scope", "id"} rows
73
+ dc.get_items(filters={"name": "S2A_MSIL2A_20160229T032652*"}, long=False) # item ids of one tile and date
74
+ ```
75
+
76
+ `get_items` returns every item without a filter, which is tens of thousands of ids and takes a few seconds. Narrow it with `name` patterns (`*` or `%` match any sequence) or use the searches below.
77
+
78
+ ## Search
79
+
80
+ Searches are JSON filters made of comparison nodes, each with a `path` into the document, a `comparator`, a `value` and a `valueType`, combined by logical nodes with `and`, `or` and `not`. The server evaluates them against the declared indexes.
81
+
82
+ ```python
83
+ clear_images_2016 = {
84
+ "type": "logical", "combinator": "and", "filters": [
85
+ {"type": "comparison", "comparator": "equals", "path": ["collection"], "value": "sentinel_2_l2a", "valueType": "string"},
86
+ {"type": "comparison", "comparator": "lessThanOrEqual", "path": ["properties", "eo:cloud_cover"], "value": 20, "valueType": "number"},
87
+ {"type": "comparison", "comparator": "greaterThanOrEqual", "path": ["properties", "datetime"], "value": "2016-01-01T00:00:00Z", "valueType": "date"},
88
+ {"type": "comparison", "comparator": "lessThan", "path": ["properties", "datetime"], "value": "2017-01-01T00:00:00Z", "valueType": "date"},
89
+ ],
90
+ }
91
+ ids = dc.get_items_by_enhanced_filter(clear_images_2016, return_mode="ids")
92
+ items = dc.get_items_by_enhanced_filter(clear_images_2016, return_mode="metadata") # full documents
93
+ ```
94
+
95
+ A group marked `"inherited": true` is evaluated against the ancestors of each candidate, so a search can select products by properties of their source image. This finds field-delineation products whose source image had at most 20 percent cloud cover.
96
+
97
+ ```python
98
+ fields_from_clear_images = {
99
+ "type": "logical", "combinator": "and", "filters": [
100
+ {"type": "comparison", "comparator": "equals", "path": ["collection"], "value": "smart_agriculture", "valueType": "string"},
101
+ {"type": "logical", "combinator": "and", "inherited": True, "filters": [
102
+ {"type": "comparison", "comparator": "equals", "path": ["collection"], "value": "sentinel_2_l2a", "valueType": "string"},
103
+ {"type": "comparison", "comparator": "lessThanOrEqual", "path": ["properties", "eo:cloud_cover"], "value": 20, "valueType": "number"},
104
+ ]},
105
+ ],
106
+ }
107
+ product_ids = dc.get_items_by_enhanced_filter(fields_from_clear_images)
108
+ ```
109
+
110
+ | Comparators | Meaning |
111
+ |---|---|
112
+ | `equals`, `notEquals` | equality, or inequality |
113
+ | `lessThan`, `lessThanOrEqual`, `greaterThan`, `greaterThanOrEqual` | ordered comparison of numbers, dates or strings |
114
+ | `in` | the value is one of a list |
115
+ | `like`, `notLike` | text pattern, `*` or `%` for any sequence and `?` for one character |
116
+ | `contains`, `containsAny`, `containsAll` | array membership |
117
+ | `isNull`, `isNotNull`, `isEmpty`, `isNotEmpty` | presence checks, pass `"value": null` |
118
+
119
+ Value types are `string`, `number`, `integer`, `boolean`, `date` and `array`. A document that lacks the field matches neither a typed comparison nor its negation, so incomplete metadata is left out rather than silently included.
120
+
121
+ Three helpers build the common spatial and temporal searches for you, and return ids or full documents with `return_mode`.
122
+
123
+ ```python
124
+ dc.get_items_by_timerange("2016-02-01T00:00:00Z", "2016-03-01T00:00:00Z")
125
+ dc.get_items_by_bbox(103.5, 19.8, 104.2, 20.8) # west, south, east, north
126
+ dc.get_items_by_bbox_and_timerange([103.5, 19.8, 104.2, 20.8], ["2016-02-01T00:00:00Z", "2016-03-01T00:00:00Z"])
127
+ ```
128
+
129
+ Lineage and facets have their own helpers.
130
+
131
+ ```python
132
+ image = "S2A_MSIL2A_20160229T032652_N0500_R018_T48QUH_20231011T191655"
133
+ product = image + "_smart_agriculture_300"
134
+
135
+ dc.get_source_original_item_ids_from_derived_item(product) # the image the product came from
136
+ dc.get_related_item_ids_from_original_item(image) # every product of the image
137
+ dc.get_sibling_derived_item_ids(image, collection_id="smart_agriculture")
138
+ dc.get_item_ids_by_top_facet_catalog("water_basin") # products placed under any river basin
139
+ dc.get_item_ids_by_facet_value_catalog("water_basin_mekong") # products in one basin
140
+ dc.get_item_facet_placements(product, collection_id="smart_agriculture")
141
+ ```
142
+
143
+ ## Read metadata
144
+
145
+ ```python
146
+ document = dc.get_bulk_metadata(product) # the whole STAC item
147
+ subset = dc.get_bulk_metadata(product, paths=["/collection", "/properties/datetime", "/assets"])
148
+ dc.extract_metadata_value("/properties/datetime", pname=image) # one value by JSON pointer
149
+ report = dc.list_item_asset_entries(product, check_storage=True) # every asset and whether its file is in storage
150
+ ```
151
+
152
+ `dc.as_json(document)` formats any of these for display.
153
+
154
+ ## Download assets
155
+
156
+ ```python
157
+ dc.download_item_asset(product, "dafab-field-boundaries-thumbnail", destination_dir="downloads")
158
+ href = dc.build_stable_asset_href(image, "TCI_20m") # the permanent URL of an asset
159
+ dc.download_asset_from_stable_href(href, destination_dir="downloads")
160
+ dc.download_all_derived_item_assets(product, destination_dir="downloads")
161
+ ```
162
+
163
+ Downloads go to `destination_dir`, the current directory by default, and refuse to replace an existing file unless `overwrite=True`. Where a local copy of the storage is mounted, `download_item_asset` uses it and reports `mode == "local_posix"`.
164
+
165
+ `dc.get_map(items, output_path="map.html")` renders the footprints of a list of documents to an interactive HTML map.
166
+
167
+ ## Notebook
168
+
169
+ The packaged notebook walks through all of the above against the live catalogue and runs unchanged with the shared profile. Its download cells write under `demo-data/` in the current directory.
170
+
171
+ ```bash
172
+ pip install "dafab-client[notebooks]"
173
+ python -c "import dafab_client as dc; print(dc.get_example('user'))"
174
+ jupyter notebook dafab_simple_user_workflows.ipynb
175
+ ```
176
+
177
+ ## Validate a document
178
+
179
+ The validators check an item against the schemas shipped with the client, either a local file or the stored copy on the server, without changing anything.
180
+
181
+ ```python
182
+ dc.validate_original_item(source="server", expected_item_id=image, expected_collection_id="sentinel_2_l2a")
183
+ dc.validate_derived_item(source="local", item_path="my_product.json")
184
+ ```
185
+
186
+ ## Configuration
187
+
188
+ Nothing is required for reading. These variables change the defaults.
189
+
190
+ | Variable | Effect |
191
+ |---|---|
192
+ | `DAFAB_PROFILE` | the account whose profile to load, default `user_dafab` |
193
+ | `DAFAB_PROFILE_PATH` | an explicit profile file |
194
+ | `DAFAB_PROFILE_DIR` | the directory holding `<account>/config`, default `~/.config/dafab/credentials/profiles` or `$XDG_CONFIG_HOME/dafab/credentials/profiles` |
195
+ | `DAFAB_DEMO_DATA_DIR` | where the notebook and `get_map` write, default `./demo-data` |
196
+
197
+ Set them before importing the client. A profile is a JSON file with the connection and the credentials of one account.
198
+
199
+ ```json
200
+ {
201
+ "rucio_host": "https://dafab.cern.ch",
202
+ "auth_host": "https://dafab.cern.ch",
203
+ "auth_type": "userpass",
204
+ "account": "my_account",
205
+ "creds": {"username": "my_account", "password": "..."},
206
+ "ca_cert": "$client_path/_rucio/secrets/user_dafab/rucio_ca_bundle.pem",
207
+ "vo": "def"
208
+ }
209
+ ```
210
+
211
+ `ca_cert` names the TLS trust bundle. `$client_path` is the installed package, `$client_account` the account name, and `$profile_path` the directory of the profile file, so a personal profile can reuse the shipped bundle as above. Keep profile files private.
212
+
213
+ ## Publishing
214
+
215
+ Publishing images and products, attaching them to their collections and facets, and repairing collection extents are done by DaFab's processing pipelines with the publication helpers of this package, `ensure_item`, `set_metadata`, `publish_original_asset`, `publish_derived_asset` and the `sync_*_collection_extent` family. They write to the catalogue and need an account with write access. Project members find the procedures in the repository's `docs/`. To request an account, contact the project through [dafab-ai.eu](https://www.dafab-ai.eu).
216
+
217
+ ## Licence
218
+
219
+ Apache License 2.0. The package bundles the Rucio client modules, which are also Apache 2.0.
@@ -1,3 +1,4 @@
1
+ LICENSE
1
2
  MANIFEST.in
2
3
  pyproject.toml
3
4
  readme.md