fusion-platform-python-sdk 1.17.6__tar.gz → 1.17.9__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.
Files changed (57) hide show
  1. {fusion_platform_python_sdk-1.17.6/fusion_platform_python_sdk.egg-info → fusion_platform_python_sdk-1.17.9}/PKG-INFO +1 -1
  2. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/__init__.py +2 -2
  3. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/command.py +112 -44
  4. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/translations.py +18 -5
  5. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9/fusion_platform_python_sdk.egg-info}/PKG-INFO +1 -1
  6. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/setup.py +1 -1
  7. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/LICENSE.txt +0 -0
  8. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/MANIFEST.in +0 -0
  9. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/README.md +0 -0
  10. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/__main__.py +0 -0
  11. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/base.py +0 -0
  12. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/common/__init__.py +0 -0
  13. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/common/raise_thread.py +0 -0
  14. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/common/utilities.py +0 -0
  15. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/detailed_example.py +0 -0
  16. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/documentation.py +0 -0
  17. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/fusion_platform_sdk.pdf +0 -0
  18. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/glasgow.geojson +0 -0
  19. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/lake_district.geojson +0 -0
  20. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/localisations.py +0 -0
  21. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/localise.py +0 -0
  22. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/__init__.py +0 -0
  23. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/credit.md +0 -0
  24. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/credit.py +0 -0
  25. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/data.md +0 -0
  26. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/data.py +0 -0
  27. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/data_file.md +0 -0
  28. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/data_file.py +0 -0
  29. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/fields.py +0 -0
  30. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/model.py +0 -0
  31. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/organisation.md +0 -0
  32. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/organisation.py +0 -0
  33. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process.md +0 -0
  34. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process.py +0 -0
  35. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process_execution.md +0 -0
  36. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process_execution.py +0 -0
  37. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process_service_execution.md +0 -0
  38. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process_service_execution.py +0 -0
  39. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process_service_execution_log.md +0 -0
  40. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/process_service_execution_log.py +0 -0
  41. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/service.md +0 -0
  42. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/service.py +0 -0
  43. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/user.md +0 -0
  44. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/models/user.py +0 -0
  45. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/quick_example.py +0 -0
  46. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform/session.py +0 -0
  47. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform_python_sdk.egg-info/SOURCES.txt +0 -0
  48. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform_python_sdk.egg-info/dependency_links.txt +0 -0
  49. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform_python_sdk.egg-info/entry_points.txt +0 -0
  50. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform_python_sdk.egg-info/requires.txt +0 -0
  51. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/fusion_platform_python_sdk.egg-info/top_level.txt +0 -0
  52. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/setup.cfg +0 -0
  53. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/tests/test_base.py +0 -0
  54. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/tests/test_command.py +0 -0
  55. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/tests/test_init.py +0 -0
  56. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/tests/test_localise.py +0 -0
  57. {fusion_platform_python_sdk-1.17.6 → fusion_platform_python_sdk-1.17.9}/tests/test_session.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fusion-platform-python-sdk
3
- Version: 1.17.6
3
+ Version: 1.17.9
4
4
  Summary: Python SDK used to interact with the Fusion Platform(r)
5
5
  Home-page: https://github.com/d-cat-support/fusion-platform-python-sdk
6
6
  Author: Digital Content Analysis Technology Ltd
@@ -11,8 +11,8 @@ API, and this is defined within the corresponding OpenAPI 3.0 specification, whi
11
11
  """
12
12
 
13
13
  # Do not modify the following two lines as they are maintained by the version.sh script.
14
- __version__ = '1.17.6'
15
- __version_date__ = '2025-03-26T16:04:58Z'
14
+ __version__ = '1.17.9'
15
+ __version_date__ = '2025-04-29T13:10:22Z'
16
16
 
17
17
  # Exclude certain sub-modules from documentation.
18
18
  # @formatter:off
@@ -8,28 +8,28 @@ author: Matthew Casey
8
8
 
9
9
  import argparse
10
10
  from argparse import RawTextHelpFormatter
11
+ from collections import defaultdict
11
12
  from copy import deepcopy
12
13
  import csv
13
14
  from datetime import datetime, timedelta, timezone
14
- from dateutil.relativedelta import relativedelta
15
15
  from decimal import Decimal
16
16
  from functools import partial
17
- import i18n
18
17
  import json
19
18
  import logging
20
- from marshmallow.utils import _Missing
21
19
  import os
22
- from pathos.multiprocessing import ProcessPool as Pool
23
- from prompt_toolkit import prompt
24
- from prompt_toolkit import print_formatted_text as print
25
- from prompt_toolkit.completion import WordCompleter
26
- from prompt_toolkit.validation import Validator
27
20
  import re
28
21
  import shutil
29
22
  import tempfile
30
23
  from time import sleep
31
- from tqdm import tqdm
32
24
  import uuid
25
+
26
+ from dateutil.relativedelta import relativedelta
27
+ import i18n
28
+ from pathos.multiprocessing import ProcessPool as Pool
29
+ from prompt_toolkit import print_formatted_text as print, prompt
30
+ from prompt_toolkit.completion import WordCompleter
31
+ from prompt_toolkit.validation import Validator
32
+ from tqdm import tqdm
33
33
  import yaml
34
34
 
35
35
  # Make sure localisation is set up before any SDK-specific imports.
@@ -455,9 +455,35 @@ class Command(Base):
455
455
 
456
456
  self.__print_process(process)
457
457
 
458
- # Display the status of any execution.
458
+ # Group executions, if they are in groups.
459
+ groups = defaultdict(list)
460
+
459
461
  for execution in process.executions:
460
- self.__print_execution(execution)
462
+ if (hasattr(execution, Model._FIELD_GROUP_ID) and (execution.group_id is not None)) and (
463
+ hasattr(execution, Model._FIELD_GROUP_INDEX) and (execution.group_index is not None)) and (
464
+ hasattr(execution, Model._FIELD_GROUP_COUNT) and (execution.group_count is not None)):
465
+ groups[execution.group_id].append(execution)
466
+
467
+ # Display the status of any execution, in groups if used.
468
+ if len(groups) > 0:
469
+ group_number = 1
470
+
471
+ for group_id, group_executions in groups.items():
472
+ self.__print(logging.INFO,
473
+ i18n.t('command.log_execution_group_id', group_number=group_number, group_count=len(groups), group_id=group_id))
474
+
475
+ for execution in sorted(group_executions, key=lambda execution: execution.group_index):
476
+ self.__print_execution(execution, label=i18n.t('command.log_execution_group_index', group_index=execution.group_index,
477
+ group_count=execution.group_count))
478
+
479
+ group_number += 1
480
+ self.__print(logging.INFO, i18n.t('command.log_bookend'))
481
+
482
+ else:
483
+ for execution in process.executions:
484
+ self.__print_execution(execution)
485
+
486
+ self.__print(logging.INFO, i18n.t('command.log_bookend'))
461
487
 
462
488
  except CommandError as e:
463
489
  self.__print(logging.DEBUG, str(e))
@@ -507,8 +533,8 @@ class Command(Base):
507
533
  group_count = None
508
534
  group_index = None
509
535
 
510
- if hasattr(execution, Model._FIELD_GROUP_INDEX) and (execution.group_index is not None) and (not isinstance(execution.group_index, _Missing)) and hasattr(
511
- execution, Model._FIELD_GROUP_COUNT) and (execution.group_count is not None) and (not isinstance(execution.group_count, _Missing)):
536
+ if hasattr(execution, Model._FIELD_GROUP_INDEX) and (execution.group_index is not None) and (isinstance(execution.group_index, int)) and hasattr(
537
+ execution, Model._FIELD_GROUP_COUNT) and (execution.group_count is not None) and (isinstance(execution.group_count, int)):
512
538
  group_count = execution.group_count
513
539
  group_index = execution.group_index
514
540
  number_of_group_digits = len(str(group_count))
@@ -528,7 +554,8 @@ class Command(Base):
528
554
  if (started_at is None) or (execution.started_at < started_at):
529
555
  started_at = execution.started_at
530
556
 
531
- execution_ended_at = execution.ended_at if hasattr(execution, Model._FIELD_ENDED_AT) and (execution.ended_at is not None) else datetime.now(timezone.utc)
557
+ execution_ended_at = execution.ended_at if hasattr(execution, Model._FIELD_ENDED_AT) and (execution.ended_at is not None) else datetime.now(
558
+ timezone.utc)
532
559
 
533
560
  if (ended_at is None) or (execution_ended_at > ended_at):
534
561
  ended_at = execution_ended_at
@@ -700,7 +727,7 @@ class Command(Base):
700
727
  progress_bar.close()
701
728
 
702
729
  def download_process_execution(self, organisation, process_name, download_inputs, download_outputs, download_storage, download_intermediate,
703
- download_components, save_metrics, wait_for_execution_to_complete):
730
+ download_components, save_metrics, stac_only, wait_for_execution_to_complete):
704
731
  """
705
732
  Downloads the inputs and/or outputs from a process or execution(s).
706
733
 
@@ -713,6 +740,7 @@ class Command(Base):
713
740
  download_intermediate: Should intermediate components be downloaded?
714
741
  download_components: The names of the components that should be downloaded? If None or [], then all components are downloaded.
715
742
  save_metrics: Save process metrics to file?
743
+ stac_only: Save only stac assets?
716
744
  wait_for_execution_to_complete: Optionally wait for completion of the execution?
717
745
 
718
746
  Returns:
@@ -723,9 +751,9 @@ class Command(Base):
723
751
  if (not download_inputs) and (not download_outputs) and (not download_storage):
724
752
  download_outputs = True
725
753
 
726
- self.__print(logging.INFO,
727
- i18n.t('command.download_process_execution', process=process_name, inputs=download_inputs, outputs=download_outputs, storage=download_storage,
728
- intermediate=download_intermediate, metrics=save_metrics, components=download_components))
754
+ self.__print(logging.INFO, i18n.t('command.download_process_execution', process=process_name, inputs=download_inputs, outputs=download_outputs,
755
+ storage=download_storage, intermediate=download_intermediate, stac_only=stac_only, metrics=save_metrics,
756
+ components=download_components))
729
757
 
730
758
  # We are downloading from an existing process.
731
759
  process, execution = self.get_process_or_execution(organisation, process_name)
@@ -790,8 +818,9 @@ class Command(Base):
790
818
  downloads.extend(execution_downloads)
791
819
  metrics.extend(execution_metrics)
792
820
 
793
- # Download the files.
794
- self.__download_files(downloads)
821
+ # Download the files unless we only want the stac information
822
+ if not stac_only:
823
+ self.__download_files(downloads)
795
824
 
796
825
  # Save the metrics to file.
797
826
  if save_metrics and (len(metrics) > 0):
@@ -1042,6 +1071,38 @@ class Command(Base):
1042
1071
  """
1043
1072
  return uuid.uuid5(uuid.NAMESPACE_URL, f"{process_id}_{group_count}_{group_index}_{ssd_id}_{chain_index}")
1044
1073
 
1074
+ def list_processes(self, organisation):
1075
+ """
1076
+ Lists all configured processes.
1077
+
1078
+ Args:
1079
+ organisation: The logged in organisation.
1080
+ """
1081
+ for process in organisation.processes:
1082
+ executions = [execution for execution in process.executions]
1083
+
1084
+ # Get information about any groups.
1085
+ groups = defaultdict(list)
1086
+
1087
+ for execution in executions:
1088
+ if (hasattr(execution, Model._FIELD_GROUP_ID) and (execution.group_id is not None)) and (
1089
+ hasattr(execution, Model._FIELD_GROUP_INDEX) and (execution.group_index is not None)) and (
1090
+ hasattr(execution, Model._FIELD_GROUP_COUNT) and (execution.group_count is not None)):
1091
+ groups[execution.group_id].append(execution)
1092
+
1093
+ # Calculate the overall progress and for each group.
1094
+ progress = sum([execution.progress for execution in executions]) // len(executions)
1095
+ group_progress = ''
1096
+
1097
+ for i, group in enumerate(groups.values()):
1098
+ progress = sum([execution.progress for execution in group]) // len(group)
1099
+ group_progress += i18n.t('command.log_process_group', group_number=(i + 1), executions=len(group), progress=progress)
1100
+
1101
+ # Log the process information.
1102
+ self.__print(logging.INFO,
1103
+ i18n.t('command.log_process_summary', process=process.name, executions=len(executions), progress=progress, groups=len(groups),
1104
+ group_progress=group_progress))
1105
+
1045
1106
  def login(self, deployment, email, organisation_name):
1046
1107
  """
1047
1108
  Logs into the desired Fusion Platform(r) deployment and allows the user to select an organisation.
@@ -1117,12 +1178,16 @@ class Command(Base):
1117
1178
  # Login to the correct deployment and select the organisation.
1118
1179
  organisation, _, _ = self.login(arguments.deployment, arguments.email, arguments.organisation)
1119
1180
 
1120
- # Perform the display, start, define or download.
1121
- if arguments.command == i18n.t('command.display.command'):
1122
- # Display a service or process with the specified name or ids. If a service is displayed, we do not display a process.
1181
+ # Perform the list, display, start, define or download.
1182
+ if arguments.command == i18n.t('command.list.command'):
1183
+ # List all processes.
1184
+ self.list_processes(organisation)
1185
+
1186
+ elif arguments.command == i18n.t('command.display.command'):
1187
+ # Display a service or process with the specified name or ids. If a process is displayed, we do not display a service.
1123
1188
  for process_or_service in arguments.process_or_service:
1124
- if not self.display_service(organisation, process_or_service):
1125
- if not self.display_process(organisation, process_or_service):
1189
+ if not self.display_process(organisation, process_or_service):
1190
+ if not self.display_service(organisation, process_or_service):
1126
1191
  self.__print(logging.WARNING, i18n.t('command.no_process_or_service', process_or_service=process_or_service))
1127
1192
 
1128
1193
  elif arguments.command == i18n.t('command.start.command'):
@@ -1142,7 +1207,7 @@ class Command(Base):
1142
1207
  # Also perform the download, if required.
1143
1208
  if arguments.download:
1144
1209
  process = self.download_process_execution(organisation, process_name, arguments.inputs, arguments.outputs, arguments.storage,
1145
- arguments.intermediate, arguments.component, arguments.metrics,
1210
+ arguments.intermediate, arguments.component, arguments.metrics, arguments.stac,
1146
1211
  not arguments.no_wait_for_completion)
1147
1212
 
1148
1213
  # And optionally remove the process and its inputs.
@@ -1166,7 +1231,8 @@ class Command(Base):
1166
1231
  for process_name in arguments.process:
1167
1232
  # Download the process.
1168
1233
  process = self.download_process_execution(organisation, process_name, arguments.inputs, arguments.outputs, arguments.storage,
1169
- arguments.intermediate, arguments.component, arguments.metrics, not arguments.no_wait_for_completion)
1234
+ arguments.intermediate, arguments.component, arguments.metrics, arguments.stac,
1235
+ not arguments.no_wait_for_completion)
1170
1236
 
1171
1237
  # And optionally remove the process and its inputs.
1172
1238
  if arguments.remove:
@@ -1203,13 +1269,14 @@ class Command(Base):
1203
1269
  version=i18n.t('command.version_content', version=fusion_platform.__version__, version_date=fusion_platform.__version_date__))
1204
1270
 
1205
1271
  subparsers.required = True
1272
+ parser_list = subparsers.add_parser(i18n.t('command.list.command'), help=i18n.t('command.list.help'))
1206
1273
  parser_display = subparsers.add_parser(i18n.t('command.display.command'), help=i18n.t('command.display.help'))
1207
1274
  parser_start = subparsers.add_parser(i18n.t('command.start.command'), help=i18n.t('command.start.help'))
1208
1275
  parser_define = subparsers.add_parser(i18n.t('command.define.command'), help=i18n.t('command.define.help'))
1209
1276
  parser_download = subparsers.add_parser(i18n.t('command.download.command'), help=i18n.t('command.download.help'))
1210
1277
 
1211
1278
  # Add in the common arguments.
1212
- for subparser in [parser_display, parser_start, parser_define, parser_download]:
1279
+ for subparser in [parser_list, parser_display, parser_start, parser_define, parser_download]:
1213
1280
  subparser.add_argument(i18n.t('command.deployment_short'), i18n.t('command.deployment_long'), help=i18n.t('command.deployment_help'),
1214
1281
  default=Command._DEPLOYMENT_PRODUCTION_IRL)
1215
1282
  subparser.add_argument(i18n.t('command.email_short'), i18n.t('command.email_long'), help=i18n.t('command.email_help'))
@@ -1222,9 +1289,10 @@ class Command(Base):
1222
1289
 
1223
1290
  # Start arguments.
1224
1291
  parser_start.add_argument(i18n.t('command.start.definition_long'), help=i18n.t('command.start.definition_help'), nargs='+')
1225
- parser_start.add_argument(i18n.t('command.start.input_list_short'), i18n.t('command.start.input_list_long'), help=i18n.t('command.start.input_list_help'),
1292
+ parser_start.add_argument(i18n.t('command.start.input_list_short'), i18n.t('command.start.input_list_long'),
1293
+ help=i18n.t('command.start.input_list_help'), nargs='*')
1294
+ parser_start.add_argument(i18n.t('command.start.options_short'), i18n.t('command.start.options_long'), help=i18n.t('command.start.options_help'),
1226
1295
  nargs='*')
1227
- parser_start.add_argument(i18n.t('command.start.options_short'), i18n.t('command.start.options_long'), help=i18n.t('command.start.options_help'), nargs='*')
1228
1296
  parser_start.add_argument(i18n.t('command.start.wait_for_start_short'), i18n.t('command.start.wait_for_start_long'),
1229
1297
  help=i18n.t('command.start.wait_for_start_help'), default=False, action="store_true")
1230
1298
  parser_start.add_argument(i18n.t('command.start.download_short'), i18n.t('command.start.download_long'), help=i18n.t('command.start.download_help'),
@@ -1245,6 +1313,8 @@ class Command(Base):
1245
1313
  nargs='*')
1246
1314
  parser_start.add_argument(i18n.t('command.start.no_wait_for_completion_short'), i18n.t('command.start.no_wait_for_completion_long'),
1247
1315
  help=i18n.t('command.start.no_wait_for_completion_help'), default=False, action="store_true")
1316
+ parser_start.add_argument(i18n.t('command.start.stac_only_short'), i18n.t('command.start.stac_only_long'), help=i18n.t('command.start.stac_only_help'),
1317
+ default=False, action="store_true")
1248
1318
 
1249
1319
  # Define arguments.
1250
1320
  parser_define.add_argument(i18n.t('command.define.process_long'), help=i18n.t('command.define.process_help'), nargs='+')
@@ -1267,10 +1337,12 @@ class Command(Base):
1267
1337
  help=i18n.t('command.start.intermediate_help'), default=False, action="store_true")
1268
1338
  parser_download.add_argument(i18n.t('command.start.metrics_short'), i18n.t('command.start.metrics_long'), help=i18n.t('command.start.metrics_help'),
1269
1339
  default=False, action="store_true")
1270
- parser_download.add_argument(i18n.t('command.start.component_short'), i18n.t('command.start.component_long'), help=i18n.t('command.start.component_help'),
1271
- nargs='*')
1340
+ parser_download.add_argument(i18n.t('command.start.component_short'), i18n.t('command.start.component_long'),
1341
+ help=i18n.t('command.start.component_help'), nargs='*')
1272
1342
  parser_download.add_argument(i18n.t('command.start.no_wait_for_completion_short'), i18n.t('command.start.no_wait_for_completion_long'),
1273
1343
  help=i18n.t('command.start.no_wait_for_completion_help'), default=False, action="store_true")
1344
+ parser_download.add_argument(i18n.t('command.start.stac_only_short'), i18n.t('command.start.stac_only_long'), help=i18n.t('command.start.stac_only_help'),
1345
+ default=False, action="store_true")
1274
1346
 
1275
1347
  return parser.parse_args()
1276
1348
 
@@ -1290,18 +1362,20 @@ class Command(Base):
1290
1362
  else:
1291
1363
  print(message)
1292
1364
 
1293
- def __print_execution(self, execution):
1365
+ def __print_execution(self, execution, label=None):
1294
1366
  """
1295
1367
  Prints an execution. This just shows the status in a simple format.
1296
1368
 
1297
1369
  Args:
1298
1370
  execution: The execution to be logged.
1371
+ label: Optional label for the execution. Default None.
1299
1372
  """
1373
+ label = '' if label is None else label
1300
1374
 
1301
1375
  # Form the status of the execution.
1302
1376
  status = ''
1303
- group = ''
1304
- abort_reason = i18n.t('command.log_execution_abort_reason', abort_reason=execution.abort_reason) if hasattr(execution, Model._FIELD_ABORT_REASON) else ''
1377
+ abort_reason = i18n.t('command.log_execution_abort_reason', abort_reason=execution.abort_reason) if hasattr(execution,
1378
+ Model._FIELD_ABORT_REASON) else ''
1305
1379
  exit_type = i18n.t('command.log_execution_exit_type', exit_type=execution.exit_type) if hasattr(execution, Model._FIELD_EXIT_TYPE) else ''
1306
1380
 
1307
1381
  if execution.success:
@@ -1323,16 +1397,10 @@ class Command(Base):
1323
1397
  ended_at = i18n.t('command.log_execution_ended_at', ended_at=execution.ended_at.strftime('%Y-%m-%d %H:%M:%S')) if hasattr(execution,
1324
1398
  Model._FIELD_ENDED_AT) else ''
1325
1399
  period = i18n.t('command.log_execution_period', started_at=started_at, ended_at=ended_at)
1326
- duration = i18n.t('command.log_execution_duration', minutes=round((execution.ended_at - execution.started_at).total_seconds() // 60)) if hasattr(execution,
1327
- Model._FIELD_ENDED_AT) and (
1328
- execution.ended_at is not None) else ''
1329
-
1330
- if (hasattr(execution, Model._FIELD_GROUP_ID) and (execution.group_id is not None)) and (
1331
- hasattr(execution, Model._FIELD_GROUP_INDEX) and (execution.group_index is not None)) and (
1332
- hasattr(execution, Model._FIELD_GROUP_COUNT) and (execution.group_count is not None)):
1333
- group = i18n.t('command.log_execution_group', group_id=execution.group_id, group_index=execution.group_index, group_count=execution.group_count)
1400
+ duration = i18n.t('command.log_execution_duration', minutes=round((execution.ended_at - execution.started_at).total_seconds() // 60)) if hasattr(
1401
+ execution, Model._FIELD_ENDED_AT) and (execution.ended_at is not None) else ''
1334
1402
 
1335
- self.__print(logging.INFO, i18n.t('command.log_execution', id=execution.id, period=period, status=status, duration=duration, group=group))
1403
+ self.__print(logging.INFO, i18n.t('command.log_execution', id=execution.id, label=label, period=period, status=status, duration=duration))
1336
1404
 
1337
1405
  def __print_process(self, process):
1338
1406
  """
@@ -20,7 +20,10 @@ i18n.add_translation('command.no_such_organisation', 'No such organisation \'%{o
20
20
  i18n.add_translation('command.no_such_input', 'No such input \'%{input_name}\'', 'en')
21
21
  i18n.add_translation('command.no_executions', 'No executions for process \'%{process}\'', 'en')
22
22
  i18n.add_translation('command.invalid_login_response', 'Incorrect username or password', 'en')
23
- i18n.add_translation('command.log_execution_group', ' (group \'%{group_id}\' %{group_index} of %{group_count})', 'en')
23
+ i18n.add_translation('command.log_process_summary', '\'%{process}\': %{executions} execution(s) in %{groups} group(s) (%{progress}%% complete);%{group_progress}', 'en')
24
+ i18n.add_translation('command.log_process_group', ' %{group_number}: %{executions} execution(s) (%{progress}%% complete);', 'en')
25
+ i18n.add_translation('command.log_execution_group_index', ' %{group_index} of %{group_count}', 'en')
26
+ i18n.add_translation('command.log_execution_group_id', 'Group %{group_number} of %{group_count} (%{group_id}):', 'en')
24
27
  i18n.add_translation('command.log_execution_duration', ' - %{minutes} minute(s)', 'en')
25
28
  i18n.add_translation('command.log_execution_period', ' (%{started_at}%{ended_at})', 'en')
26
29
  i18n.add_translation('command.log_execution_ended_at', ' -> %{ended_at}', 'en')
@@ -39,7 +42,7 @@ i18n.add_translation('command.log_dispatchers', 'Dispatchers:', 'en')
39
42
  i18n.add_translation('command.log_options', 'Options:', 'en')
40
43
  i18n.add_translation('command.log_outputs', 'Outputs:', 'en')
41
44
  i18n.add_translation('command.log_inputs', 'Inputs:', 'en')
42
- i18n.add_translation('command.log_execution', 'Execution \'%{id}\'%{period}: %{status}%{duration}%{group}', 'en')
45
+ i18n.add_translation('command.log_execution', 'Execution%{label} \'%{id}\'%{period}: %{status}%{duration}', 'en')
43
46
  i18n.add_translation('command.log_service', 'Service \'%{service}\'', 'en')
44
47
  i18n.add_translation('command.log_process', 'Process \'%{process}\'', 'en')
45
48
  i18n.add_translation('command.log_field', '%{field}: %{value}', 'en')
@@ -65,7 +68,7 @@ i18n.add_translation('command.organisation', 'Organisation', 'en')
65
68
  i18n.add_translation('command.find_inputs', 'Finding %{inputs} input file(s)...', 'en')
66
69
  i18n.add_translation('command.executing', 'Executing...', 'en')
67
70
  i18n.add_translation('command.email', 'Email', 'en')
68
- i18n.add_translation('command.download_process_execution', 'Downloading \'%{process}\' (inputs %{inputs}, outputs %{outputs}, storage %{storage}, intermediate %{intermediate}, metrics %{metrics}, components %{components})', 'en')
71
+ i18n.add_translation('command.download_process_execution', 'Downloading \'%{process}\' (inputs %{inputs}, outputs %{outputs}, storage %{storage}, intermediate %{intermediate}, STAC only %{stac_only}, metrics %{metrics}, components %{components})', 'en')
69
72
  i18n.add_translation('command.download_process', 'Downloading process \'%{process}\' to %{output}', 'en')
70
73
  i18n.add_translation('command.download_files', 'Downloading %{files} file(s)...', 'en')
71
74
  i18n.add_translation('command.download_executions', 'Gathering files%{wait} for %{executions} execution(s)...', 'en')
@@ -83,9 +86,12 @@ i18n.add_translation('command.define.process_help', 'the name of the process, th
83
86
  i18n.add_translation('command.define.process_long', 'process', 'en')
84
87
  i18n.add_translation('command.define.help', 'outputs a YAML file for each existing process', 'en')
85
88
  i18n.add_translation('command.define.command', 'define', 'en')
86
- i18n.add_translation('command.start.no_wait_for_completion_help', 'do not wait for the execution to complete (default %%(default)s)\'', 'en')
89
+ i18n.add_translation('command.start.no_wait_for_completion_help', 'do not wait for the execution to complete (default %%(default)s)', 'en')
87
90
  i18n.add_translation('command.start.no_wait_for_completion_long', '--no_wait_for_completion', 'en')
88
91
  i18n.add_translation('command.start.no_wait_for_completion_short', '-n', 'en')
92
+ i18n.add_translation('command.start.stac_only_help', 'only download the STAC metadata for the files (default %%(default)s)', 'en')
93
+ i18n.add_translation('command.start.stac_only_long', '--stac', 'en')
94
+ i18n.add_translation('command.start.stac_only_short', '-a', 'en')
89
95
  i18n.add_translation('command.start.metrics_help', 'save process metrics to file (default %%(default)s)', 'en')
90
96
  i18n.add_translation('command.start.metrics_long', '--metrics', 'en')
91
97
  i18n.add_translation('command.start.metrics_short', '-t', 'en')
@@ -127,6 +133,8 @@ i18n.add_translation('command.display.service_or_process_help', 'the names of th
127
133
  i18n.add_translation('command.display.service_or_process_long', 'process_or_service', 'en')
128
134
  i18n.add_translation('command.display.help', 'displays service information or a configured process', 'en')
129
135
  i18n.add_translation('command.display.command', 'display', 'en')
136
+ i18n.add_translation('command.list.help', 'lists configured processes', 'en')
137
+ i18n.add_translation('command.list.command', 'list', 'en')
130
138
  i18n.add_translation('command.subparser', 'displays a service or process, or starts, defines or downloads a process', 'en')
131
139
  i18n.add_translation('command.version_content', '%%(prog)s %{version} (%{version_date})', 'en')
132
140
  i18n.add_translation('command.version_help', 'show the version information and exit', 'en')
@@ -147,6 +155,7 @@ i18n.add_translation('command.deployment_short', '-y', 'en')
147
155
  i18n.add_translation('command.epilog', '''
148
156
  For more detailed options, use:
149
157
 
158
+ fusion_platform list --help
150
159
  fusion_platform display --help
151
160
  fusion_platform start --help
152
161
  fusion_platform define --help
@@ -158,7 +167,11 @@ Use this command to display service information and processes, and to start, dow
158
167
  defined by a YAML file.
159
168
 
160
169
  Usage:
161
- The following will display information about one or more services or processes from the given \'service_or_process_name\'.
170
+ The following will list all currently configured processes:
171
+
172
+ fusion_platform list
173
+
174
+ The following will display information about one or more services or processes from the given \'service_or_process_name\':
162
175
 
163
176
  fusion_platform display <service_or_process_name> ...
164
177
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fusion-platform-python-sdk
3
- Version: 1.17.6
3
+ Version: 1.17.9
4
4
  Summary: Python SDK used to interact with the Fusion Platform(r)
5
5
  Home-page: https://github.com/d-cat-support/fusion-platform-python-sdk
6
6
  Author: Digital Content Analysis Technology Ltd
@@ -19,7 +19,7 @@ PACKAGE_DIR = pathlib.Path(__file__).parent
19
19
  # @formatter:off
20
20
  setup(
21
21
  name='fusion-platform-python-sdk',
22
- version='1.17.6',
22
+ version='1.17.9',
23
23
  description='Python SDK used to interact with the Fusion Platform(r)',
24
24
  long_description=(PACKAGE_DIR / 'README.md').read_text(),
25
25
  long_description_content_type='text/markdown',