Registry / data / mat-io

mat-io

JSON →
library1.0.0pypypi✓ verified 89d ago

A modern Python library for reading and writing MATLAB .mat files (v7 and v7.3 formats) with native support for MATLAB datatypes like table, string, datetime, struct, and cell. Version 0.7.1 runs on Python ≥3.11. Development is active, with regular releases.

pip install mat-io
INSTALL
IMPORT
SIG · MAT-IO
M
mat-io
datapythonv1.0.0
Install
11.3s avg
Import
—
Disk
326MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 11.4s
py 3.11
✓ —
✓ 10.9s
py 3.12
✓ —
✓ 11.2s
py 3.13
✓ —
✓ 11.8s
py 3.9
✕ build_error
✕ build_error
326MB installed
● package 326MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

load_from_mat
✓ from matio import load_from_mat
✗ from matio import MatFileReader
save_to_mat
✓ from matio import save_to_mat
whosmat
✓ from matio import whosmat

Load a .mat file and print variable names.

from matio import MatFileReader import os filename = 'example.mat' if os.path.exists(filename): reader = MatFileReader(filename) data = reader.read() print(data.keys()) else: print('File not found.')
Debug
Known issues
breakingPython >=3.11 required; no support for older Python versions.
fix
Upgrade Python to 3.11 or later.
affects: <0.5.0 or Python<3.11
gotchaMATLAB string arrays containing NaN are not supported in write operations (v0.5.2+).
fix
Use missing strings or convert NaN to empty strings before saving.
affects: >=0.5.2
deprecatedThe old scipy.io.loadmat is not a drop-in replacement; mat-io has different API and handles newer MATLAB types.
fix
Use mat-io's MatFileReader for proper table/string support.
affects: all
Upgrade
Version history
1.0.0latest on PyPI · released May 17, 2026
Audit
Dependencies
numpyrequiredRequired for array data handling
h5pyoptionalRequired for v7.3 HDF5-based files
Agent activity
4 hits · last 30 days
node
4
Resources
mat-io — pip install mat-io · libregistry