There has never been a one-stop library for reading mat files in Python. mat5 always relies on scipy.io, mat7.3 always depends on h5py, and reading mat files directly with h5py requires a lot of manual conversion. There is a mat73 converter, but its core logic is written in pure Python, which is very slow.
Coincidentally, there is a library in C called matio, so I wanted to create a binding using pybind11 nanobind.
pip install pymatio
import pymatio as pm
print(pm.get_library_version())
print(pm.loadmat('file.mat'))
git clone https://github.com/myuanz/pymatio
pip install .
Basic dependencies such as zlib and hdf5 will be automatically built cross-platform.
Windows usually doesn't come with a built-in build toolchain. You can refer to this page to download the Microsoft C++ Build Tools
. Follow the image examples to build the recommended toolchain and click install. Completing this step is sufficient; you don't need to install Rust afterwards.
- Package as a whl file
- Add basic tests for successful builds
- Add cibuildwheel packaging for whl
- Github Action
- Automatically handle virtual environments when compiling extensions
- Complete loadmat
- Complete savemat
- Free-threaded whl
- Import tests from scio and mat73
- Add types
- Add benchmarks
- With scio
- With mat73
- With Free-Thread