pymatreader
Convenient reader for Matlab mat files
What it is and what it does
pymatreader is a Python module that reads MATLAB .mat files and converts them into Python dictionaries. It handles both the older MATLAB format (versions before 7.3) and the newer HDF5-based format (>= 7.3), returning the same dictionary structure regardless of which format the input file uses.
The package depends on h5py, numpy, scipy, and xmltodict to handle the underlying file parsing and data conversion. It requires Python >= 3.10 and is classified as production-stable. The typical workflow is a single import and one function call to load an entire .mat file into memory as a dictionary.
Use it for:
- Load MATLAB simulation or analysis results into Python for further processing or visualization.
- Migrate legacy MATLAB datasets into Python-based data pipelines without manual format conversion.
- Read HDF5-based .mat files from modern MATLAB versions in scientific computing workflows.
- Extract variables from .mat files for use in machine learning or statistical analysis with numpy and scipy.
- Batch import multiple MATLAB files in research or engineering automation scripts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads MATLAB .mat files in both legacy and HDF5-based formats (>= 7.3) and returns their contents as Python dictionaries.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a specific, well-defined problem. Choose it if you need to read MATLAB files in Python.
Install
pymatreader on PyPI
pip
pip install pymatreaderuv
uv add pymatreaderpoetry
poetry add pymatreaderInstalling pymatreader
Before you install
Low friction: pure Python wheel with four well-established scientific dependencies. Actively maintained with a release 102 days ago.
License in practice
BSD-2-Clause permissive license allows free use, modification, and distribution with minimal restrictions—suitable for both open and closed projects.
Quickstart
pip install pymatreader
from pymatreader import read_mat
data = read_mat(filename)
# data is a dict containing all variables from the mat file
Requires Python >= 3.10
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — h5py, numpy, scipy, xmltodict |
| Maintenance | actively maintained — 102 days since the last release |
| First released | |
| Downloads | 129,321/month — #11,675 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymatreader-1.2.3-py3-none-any.whl
Keywords: Matlab, HDF5, import
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
mat73Loads MATLAB 7.3 .mat files (stored as HDF5)…
copyleft · top 15,000 on PyPI
h5pyh5py reads and writes HDF5 files from Python,…
permissive · top 1,000 on PyPI
h5netcdfh5netcdf reads and writes netCDF4 files using…
permissive · top 5,000 on PyPI
npTDMSRead and write TDMS files (LabVIEW data format)…
copyleft · top 15,000 on PyPI
mmcifProvides native Python and C++ bindings to…
permissive · top 5,000 on PyPI
asammdfasammdf parses, edits, and exports ASAM MDF…
copyleft · top 5,000 on PyPI
fabioFabIO reads and writes 2D X-ray detector images…
permissive · top 15,000 on PyPI
rosettasciioRosettaSciIO reads and writes scientific data…
copyleft · top 15,000 on PyPI
pymarcpymarc reads, writes, and modifies MARC21…
unclear · top 15,000 on PyPI
PIMSPIMS provides a unified interface to read…
permissive · top 15,000 on PyPI