pyslk.hsm2json_dict

Contents

pyslk.hsm2json_dict#

pyslk.hsm2json_dict(resources: str | list = '', search_id: int = -1, recursive: bool = False, restart_file: str | None = None, schema: str | list | None = None, print_hidden: bool = False) dict[str, Union[dict, list, NoneType]]#

Extract metadata from HSM file(s) and return them in JSON structure

Parameters:
  • resources (str or list) – list of resources to be searched for

  • search_id (int) – id of a search

  • recursive (bool) – export metadata from all files in gns_path recursively

  • restart_file (str = None,) – set a restart file in which the processed metadata entries are listed

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

  • print_hidden (bool) – print read-only not-searchable metadata fields (sidecar file) [default: False]

Returns:

dictionary with keys ‘header’ (summary report), ‘metadata’ (actual metadata) and ‘file’ (None)

Return type:

dict