qecx.load_qecx¶
- qecx.load_qecx(path, *, validate=True)¶
Load a QECX file and return a
QECXFile.Format detection follows the spec: first four bytes
PK\x03\x04indicate a ZIP archive; anything else is treated as inline JSON. A leading UTF-8 BOM is stripped before detection, and the filename is never consulted.- Parameters:
validate (bool) – If
True(default), run validation on the loaded document and raiseQECXValidationFailedErrorif any error-severity findings are reported; the findings seed the returned file’sQECXFile.validate()cache. IfFalse, skip validation and return the loaded document as-is.
- Returns:
A new instance wrapping the resolved document.
- Return type:
- Raises:
FileNotFoundError – If path does not exist.
QECXLoadError – If the file cannot be parsed or contains invalid refs.
QECXValidationFailedError – If
validateisTrueand the document has one or more error-severity validation findings.