Skip to main content

中文 English

pymatio

快速、紧凑的 mat 文件读取器,在 2MiB 大小内完成 MAT5/MAT7.3 的读入,摆脱巨大的 scipy 和 h5py 依赖。基于 matio 的 Python 绑定。

Fast, compact MAT file reader supporting MAT5/MAT7.3 formats within a 2MiB footprint. Eliminates dependency on bulky scipy and h5py. Based on Python binding for matio.

背景

Python 中始终没有一个一站式读取 mat 文件的库,mat5 总是依赖 scipy.io, mat7.3 总是依赖 h5py,h5py 直接读取 mat 文件又需要很多手动转换,有一个 mat73 转换,但是核心逻辑是纯 Python 写的,又非常慢。

恰巧 C 中有一个库 matio,我就想用 pybind11 nanobind 做一个绑定。

安装

uv add pymatio

# or use pip
pip install pymatio

样例

import pymatio as pm

print(pm.get_library_version())
print(pm.loadmat('file.mat'))

对开发者

常规构建流程

git clone https://github.com/myuanz/pymatio && cd pymatio
uv sync --dev --no-install-project
# or use cmake 
cmake -S . -B build
cmake --build build

# for test data
git submodule update --init --recursive

zlib、hdf5 等基础依赖将自动下载并构建,无需系统预先安装.

Windows 编译工具链

Windows 通常没有自带的构建工具链, 你可以参考 此页, 下载Microsoft C++ Build Tools, 按照图片示例构建推荐的工具链, 点击安装. 只要完成这一步就够了, 不需要再往下安装 Rust.

路线

  • 打包为 whl 文件
  • 添加关于构建成功的基本测试
  • 添加 cibuildwheel 打包 whl
  • Github Action
  • 编译扩展时自动处理虚拟环境
  • 完成 loadmat
  • 完成 savemat
  • 自由线程 whl
  • 导入 scio 的测试
  • 导入 mat73 的测试
  • 导入 matio 的测试
  • 添加 types

Release files for pymatio 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pymatio 0.2.2
File
pymatio-0.2.2-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details
pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details
pymatio-0.2.2-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details
pymatio-0.2.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details
pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
pymatio-0.2.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.2+ x86-64 Details
pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
pymatio-0.2.2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl CPython 3.9 CPython 3.9 Linux musl 1.2+ x86-64 Details
pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details

Total release size: 35.7 MB

Release files / pymatio-0.2.2-cp314-cp314t-win_amd64.whl

Download URL pymatio-0.2.2-cp314-cp314t-win_amd64.whl
Size 1.5 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
fdcdf5091b20eae2e70bec7b293e0f770e1a1cb2d2d81ec59065d80d1ee8a3bf
BLAKE2b-256 checksum
How to use checksums
b72df884fabacaa4df4e14157c778893dca7205809b09840d340d3c41b9e5fc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 2.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
a11c14200689a455492aaddacaf6b812fba39ea4cad4367fce76c5839a83d6a7
BLAKE2b-256 checksum
How to use checksums
5e54732fad30988b3638969a2f52f21053f4d1f7b760191b46a76a323e14f13e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
639888e3edb336d192bf2fb09bc3b206dee46d886de45f40c7a843a3650b2bfb
BLAKE2b-256 checksum
How to use checksums
0f56e4bc14e0497fdf0e0d7bfc6a0ebe0ce3c65f2d79c4dc0e4fb78ae5c9dcf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp312-abi3-win_amd64.whl

Download URL pymatio-0.2.2-cp312-abi3-win_amd64.whl
Size 1.5 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c91e23efb84bc0398f200759cd39e73b4452b9dd9a18eefba36b1c9a6318146f
BLAKE2b-256 checksum
How to use checksums
3677afa2dcc2abacbe849ef6479202f8dfdb51d36bf8bf0f220a3c8ef43115c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl
Size 2.9 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
378c4272630e41e8dfa0976bb97f45f290fd33bb3b10d8da90541bbb5632d53c
BLAKE2b-256 checksum
How to use checksums
109d81f9a51c525f83608350b050e550a1e9e1e7c574abe086ce15710be850d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
4e546d4fb383092ff0769610100840b48b57f4a2656fcae7fec0d918b274a369
BLAKE2b-256 checksum
How to use checksums
620d4e00108c24b0308ed79c9765621f34d8f606889cb3ff22544bfb6de7518b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp311-cp311-win_amd64.whl

Download URL pymatio-0.2.2-cp311-cp311-win_amd64.whl
Size 1.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
0d4f0161fcad5df318862a80beb8fd12f4353d55aa1df0ee067c0b637c0a3db3
BLAKE2b-256 checksum
How to use checksums
da5653f99876f15f74cc1f91f0a343535757b3becc96fccdc4a5c8510801cd7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl
Size 2.9 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
7b1259410d27ef7ad2910244c55d515bb42a7698e25eb099d748feac9243aaf4
BLAKE2b-256 checksum
How to use checksums
eebca199ffb8d428da439410bbb9b501bc0650908c94406c0f6ac51e589727eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
18099ccb27da5199ea52b686fe56d86f2a01145f057396d722b26afffbbbaf15
BLAKE2b-256 checksum
How to use checksums
ead103551338e7549287f2ae734174945ffcea362ac4288a1ea5049015543ef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp310-cp310-win_amd64.whl

Download URL pymatio-0.2.2-cp310-cp310-win_amd64.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
8d0f6d66fa76c1c405f94068ef7caeba70204e32c013d7a19ec74702765074df
BLAKE2b-256 checksum
How to use checksums
2d2b58cca051947ef47acef084b2d59978694fd2c443e9adbd0cd0cdf6c13165
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl

Download URL pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl
Size 2.9 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
40decd518964dc237095c0fdb9a96a46fb2735d951baa368472f626ef3ad4c73
BLAKE2b-256 checksum
How to use checksums
ac44a28bafb98cd09201eaea6ebb41180f29ee3a2c8ed6700477454f9caca468
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
353afea66e0a4cb1ce08841ee2a0ef0f4c8aaf368f8421d55b8051e598d72b08
BLAKE2b-256 checksum
How to use checksums
580ddca100d6a501767340205bbde87201f033059fc911d0b374e41dcd266f31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp39-cp39-win_amd64.whl

Download URL pymatio-0.2.2-cp39-cp39-win_amd64.whl
Size 1.5 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
bd444aa32f4d55c74263e6914b4c5a779279e15152b83abc169fc57b2c41b4cf
BLAKE2b-256 checksum
How to use checksums
0ae65713354d348c71f894889ab441fdfa547c708331834b4c9ae60607f02d68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl

Download URL pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl
Size 2.9 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
26055d51225dc40a25807d3d0600a209b3d10b29d1dfec89b2fbf8a7d6706740
BLAKE2b-256 checksum
How to use checksums
94b9824b6ea8ed06e7759e9f3b1d414fdf5140a52851f5f6446dfe853b62e503
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release files / pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
273782aac39b9ace378136eb692815a4dacb8e1d2f8d422de2d3194c8b0f0a07
BLAKE2b-256 checksum
How to use checksums
113b7b661a1b3de4bdd901d7b8026f9e188d5e40af4df3eaad22c3104fb6becb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

15 release files

0.1.1

13 release files

0.1.0

14 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page