calamari.io.base.BaseLoader#

class calamari.io.base.BaseLoader#

Bases: ABC

Interface every file-format loader must implement.

A loader is a stateless class (its two methods are class methods): sniff() inspects header lines to claim a file, and load() parses it into a Measurement.

format_name: str = ''#

Short human-readable / canonical format name, e.g. 'MPMS3'. Also the token accepted by load(..., fmt=...) to force this loader.

abstractmethod classmethod sniff(lines)#

Return True if this loader recognises the file.

Parameters:

lines (list[str]) – The first lines of the file (at least the header region – see _SIGNATURE_SCAN_LINES).

Return type:

bool

abstractmethod classmethod load(path)#

Parse path into a Measurement.

Return type:

Measurement