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\x04 indicate 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:
  • path (str | Path) – Path to the file.

  • validate (bool) – If True (default), run validation on the loaded document and raise QECXValidationFailedError if any error-severity findings are reported; the findings seed the returned file’s QECXFile.validate() cache. If False, skip validation and return the loaded document as-is.

Returns:

A new instance wrapping the resolved document.

Return type:

QECXFile

Raises: