skillfed

pymatreader

Convenient reader for Matlab mat files

pymatreader v1.2.3 129.3K downloads/30d#11,675 on PyPI
Permissive license BSD-2-Clause Active released

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 pymatreader

uv

uv add pymatreader

poetry

poetry add pymatreader

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Scientific/EngineeringTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

read matlab mat filesmatlab file parser pythonhdf5 mat file readermatlab data importconvert mat to python dict
matlab-interopscientific-data

More Scientific/Engineering packages