A convenient reader for MATLAB .mat files, handling various data types and structures. Current version 1.2.2, requires Python ≥3.10. Regular updates.
pip install pymatreaderVerified import paths — ran on the pinned version, not inferred.
Basic usage to read a .mat file and access its variables.
Use `data['varname']` or set `ignore_fields=True` (default) to get attribute-style access.
Use `data = read_mat('file.mat').__dict__` to get a dict, or update code to use attribute access.Replace `from pymatreader import matfile` with `from pymatreader import read_mat`.
List available keys: `print(data.keys())` and then access the correct key.
Try opening with scipy.io.loadmat as fallback, or check file integrity.
Install h5py: `pip install h5py`.