pyslk.json2hsm_raw

Contents

pyslk.json2hsm_raw#

pyslk.json2hsm_raw(json_file: str | Path | None = None, restart_file: str | Path | None = None, schema: str | list | None = None, expect_json_lines: bool = False, verbose: bool = False, quiet: bool = False, ignore_non_existing_metadata_fields: bool = False, write_mode: str | None = None, instant_metadata_record_update: bool = False, use_res_id: bool = False, skip_bad_metadata_sets: bool = False, print_summary: bool = False, print_json_summary: bool = False, json_string: str | None = None, return_type: int = 0) str | int | CompletedProcess#

Read metadata from JSON file and write them to archived files into HSM. Use absolute paths from metadata records to identify target files.

Parameters:
  • json_file (str or Path-like or None) – JSON input file containing metadata; incompatible with json_string [default: None]

  • restart_file (str or Path-like or None,) – set a restart file in which the processed metadata entries are listed [default: None]

  • schema (str or list) – import only metadata fields of listed schemata; if str: comma-separated list without spaces

  • expect_json_lines (bool) – read JSON-lines from file instead of JSON

  • verbose (bool) – verbose mode

  • quiet (bool) – quiet mode

  • ignore_non_existing_metadata_fields (bool) – throw no error if metadata field does not exist in StrongLink

  • write_mode (str) – select write mode for metadata: OVERWRITE, KEEP, ERROR, CLEAN

  • use_res_id (bool) – use resource_id instead of path to identify file

  • skip_bad_metadata_sets (bool) – skip damaged / incomplete metadata sets [default: throw error]

  • instant_metadata_record_update (bool) – False (default): read metadata records of all files and import into StrongLink afterwards; True: import each metadata record after it has been read

  • return_type (int) – select between 0 (== str output), 1 (== exit code), 2 (subprocess output)

  • print_summary (bool) – print a summary

  • print_json_summary (bool) – print a summary as JSON

  • json_string (str) – provide a json string instead of a json file; incompatible with json_file

Returns:

stdout of the slk_helpers call

Return type:

Union[str, int, subprocess.CompletedProcess]