BlockFile¶
- class BlockFile(data: BlockData = <cfinterface.data.blockdata.BlockData object>)[source]¶
Class that models a file divided by blocks, where the reading and writing are given by a series of blocks.
- classmethod read(content: str | bytes, *args: Any, version: str | None = None, **kwargs: Any) BlockFile[source]¶
Read from a file path or buffer.
versionselects a component set from VERSIONS without mutating the class.
- classmethod read_many(paths: list[str], *, version: str | None = None) dict[str, BlockFile][source]¶
Read multiple files and return a dict keyed by file path.
- Parameters:
- pathslist[str]
File paths to read.
- versionstr or None, optional
Version key passed to
read(). Defaults to None.
- Returns:
- dict[str, BlockFile]
Mapping from each file path to its parsed BlockFile instance.