Skip to content

ISCC - Metadata Handling#

Metadata handling functions

extract_metadata(fp) #

Extract metadata from file.

Parameters:

Name Type Description Default
fp

Filepath to media file.

required

Returns:

Type Description

Metadata mapped to IsccMeta schema

embed_metadata(fp, meta, outpath=None) #

Embed metadata into a copy of the media file and return path to updated file.

Parameters:

Name Type Description Default
fp str

Filepath to source media file

required
meta

Metadata to embed (IsccMeta or dict)

required
outpath

Optional output filepath. If None, creates a temp file.

None

Returns:

Type Description
str|None

Filepath to the new media file with embedded metadata (None if no embedding supported)

IsccMeta #

Custom IsccMeta with text trimming and recursive parts support