mth5.utils.mth5_validator_standalone
Lightweight validator for MTH5 files that doesn’t require the full mth5 package. Only depends on h5py and standard library.
This standalone version is ideal for: - Building small executables (~20-30 MB vs 150+ MB) - Validation without installing full mth5 environment - Quick file checks in production environments
- Usage:
python mth5_validator_standalone.py validate file.mth5 python mth5_validator_standalone.py validate file.mth5 –verbose python mth5_validator_standalone.py validate file.mth5 –json
Author: MTH5 Development Team Date: February 9, 2026
Attributes
Classes
Validation severity levels. |
|
Container for a single validation message. |
|
Container for validation results. |
|
Standalone MTH5 file validator. |
Functions
|
CLI entry point. |
Module Contents
- class mth5.utils.mth5_validator_standalone.ValidationLevel[source]
Bases:
enum.EnumValidation severity levels.
- class mth5.utils.mth5_validator_standalone.ValidationMessage[source]
Container for a single validation message.
- level: ValidationLevel[source]
- class mth5.utils.mth5_validator_standalone.ValidationResults[source]
Container for validation results.
- messages: list[ValidationMessage] = [][source]
- add_error(category: str, message: str, path: str | None = None, **details) None[source]
Add an error message.
- add_warning(category: str, message: str, path: str | None = None, **details) None[source]
Add a warning message.
- class mth5.utils.mth5_validator_standalone.MTH5Validator(file_path: str | pathlib.Path, verbose: bool = False, check_data: bool = False)[source]
Standalone MTH5 file validator.
Validates MTH5 file structure without requiring full mth5 package. Only depends on h5py and standard library.
- validate() ValidationResults[source]
Run full validation suite.