pyslk.hsm2json_file#
- pyslk.hsm2json_file(outfile: str, resources: str | Path | list = '', search_id: int = -1, recursive: bool = False, restart_file: str | None = None, schema: str | list | None = None, write_json_lines: bool = False, write_mode: str | None = None, instant_metadata_record_output: bool = False, print_hidden: bool = False) None #
Extract metadata from HSM file(s) and return them in JSON structure
- Parameters:
outfile (
str
orPath
) – Write the output into a file instead to the stdoutresources (
str
orPath
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 spaceswrite_json_lines (
bool
= False) – write JSON-lines instead of JSONwrite_mode (
str
= None) – applies when ‘output’ is set; possible values: OVERWRITE, ERRORinstant_metadata_record_output (
bool
) – False (default): read metadata of all files and write/print out afterward; True: write/print each metadata record after it has been read (requires ‘write_json_lines’)print_hidden (
bool
) – print read-only not-searchable metadata fields (sidecar file) [default: False]
- Returns:
nothing; throws an error if writing failed
- Return type:
None