pyslk.json_dict2hsm#
- pyslk.json_dict2hsm(json_dict: dict, restart_file: str | 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) dict #
Read metadata from JSON dictionary and write them to archived files into HSM. Use absolute paths from metadata records to identify target files.
- Parameters:
json_dict (
dict
) – a dictionary representing JSONrestart_file (
str
= None,) – set a restart file in which the processed metadata entries are listedschema (
str
orlist
) – import only metadata fields of listed schemata; if str: comma-separated list without spacesexpect_json_lines (
bool
) – read JSON-lines from file instead of JSONverbose (
bool
) – verbose modequiet (
bool
) – quiet modeignore_non_existing_metadata_fields (
bool
) – do not throw an error if a metadata field is used, which does not exist in StrongLinkwrite_mode (
str
) – select write mode for metadata: OVERWRITE, KEEP, ERROR, CLEANuse_res_id (
bool
) – use resource_id instead of path to identify fileskip_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 afterward; True: import each metadata record after it has been read
- Returns:
metadata import summary (key ‘header’)
- Return type:
dict