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
orlist
) – list of resources to be searched forsearch_id (
int
) – id of a searchrecursive (
bool
) – export metadata from all files in gns_path recursivelyrestart_file (
str
= None,) – set a restart file in which the processed metadata entries are listedschema (
str
, list or None) – import only metadata fields of listed schemata; if str: comma-separated list without spacesprint_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