SectionFile¶
- class SectionFile(data: SectionData = <cfinterface.data.sectiondata.SectionData object>)[source]¶
Class that models a file divided by sections, where the reading and writing are given by a series of sections.
- classmethod read(content: str | bytes, *args: Any, version: str | None = None, **kwargs: Any) SectionFile[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, SectionFile][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, SectionFile]
Mapping from each file path to its parsed SectionFile instance.