get_format

function of dascore.io.core source

get_format(
    path: str | pathlib._local.Path | upath.core.UPath | dascore.utils.io.IOResourceManager[str, Path, UPath, IOResourceManager] ,
    file_format: str | None[str, None] = None,
    file_version: str | None[str, None] = None,
    fiber_io_hint: dict[dict[str, FiberIO], None] = None,
    **kwargs ,
)-> ‘tuple[str, str]’

Return the file’s format name and version.

Parameters

Parameter Description
path The path to the file.
file_format The known file format.
file_version The known file version.
fiber_io_hint Mapping of input type to the last-used FiberIO, used as a detection hint.

Returns

A tuple of (file_format_name, version) both as strings.

Raises

dascore.exceptions.UnknownFiberFormat - Could not determine the fiber format.

Examples

import dascore as dc

file_format, file_version = dc.get_format("examples://prodml_2.1.h5")