Skip to main content

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.

Project description

中文 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pymatio-0.2.2-cp314-cp314t-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.14tWindows x86-64

pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

pymatio-0.2.2-cp312-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12+Windows x86-64

pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ x86-64

pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ x86-64

pymatio-0.2.2-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pymatio-0.2.2-cp310-cp310-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pymatio-0.2.2-cp39-cp39-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9Windows x86-64

pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

Details for the file pymatio-0.2.2-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: pymatio-0.2.2-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymatio-0.2.2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 fdcdf5091b20eae2e70bec7b293e0f770e1a1cb2d2d81ec59065d80d1ee8a3bf
MD5 8ae41df4cd6658e4400f1bbf4299091b
BLAKE2b-256 b72df884fabacaa4df4e14157c778893dca7205809b09840d340d3c41b9e5fc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp314-cp314t-win_amd64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a11c14200689a455492aaddacaf6b812fba39ea4cad4367fce76c5839a83d6a7
MD5 f392b7907d662ea94b326d0c37d05aac
BLAKE2b-256 5e54732fad30988b3638969a2f52f21053f4d1f7b760191b46a76a323e14f13e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 639888e3edb336d192bf2fb09bc3b206dee46d886de45f40c7a843a3650b2bfb
MD5 53b953c226a9bed5466cd5b637200c25
BLAKE2b-256 0f56e4bc14e0497fdf0e0d7bfc6a0ebe0ce3c65f2d79c4dc0e4fb78ae5c9dcf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: pymatio-0.2.2-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymatio-0.2.2-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c91e23efb84bc0398f200759cd39e73b4452b9dd9a18eefba36b1c9a6318146f
MD5 54fdb9cb58d436f6e2b62214fb722268
BLAKE2b-256 3677afa2dcc2abacbe849ef6479202f8dfdb51d36bf8bf0f220a3c8ef43115c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp312-abi3-win_amd64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 378c4272630e41e8dfa0976bb97f45f290fd33bb3b10d8da90541bbb5632d53c
MD5 ed50905df7cacd565d5aee0dd76df75f
BLAKE2b-256 109d81f9a51c525f83608350b050e550a1e9e1e7c574abe086ce15710be850d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp312-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4e546d4fb383092ff0769610100840b48b57f4a2656fcae7fec0d918b274a369
MD5 e5d3b7a223be6e313a5901427e00ab06
BLAKE2b-256 620d4e00108c24b0308ed79c9765621f34d8f606889cb3ff22544bfb6de7518b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp312-abi3-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pymatio-0.2.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymatio-0.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0d4f0161fcad5df318862a80beb8fd12f4353d55aa1df0ee067c0b637c0a3db3
MD5 803f014f5c48e9ef9476708f022a9850
BLAKE2b-256 da5653f99876f15f74cc1f91f0a343535757b3becc96fccdc4a5c8510801cd7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7b1259410d27ef7ad2910244c55d515bb42a7698e25eb099d748feac9243aaf4
MD5 682c88ae0b011cf0eb81c1af8e8b9d7f
BLAKE2b-256 eebca199ffb8d428da439410bbb9b501bc0650908c94406c0f6ac51e589727eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 18099ccb27da5199ea52b686fe56d86f2a01145f057396d722b26afffbbbaf15
MD5 74e27b255b6506d366150e296f85b678
BLAKE2b-256 ead103551338e7549287f2ae734174945ffcea362ac4288a1ea5049015543ef7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pymatio-0.2.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymatio-0.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8d0f6d66fa76c1c405f94068ef7caeba70204e32c013d7a19ec74702765074df
MD5 1de9b253ff3c91c5ebbda95ff258ad05
BLAKE2b-256 2d2b58cca051947ef47acef084b2d59978694fd2c443e9adbd0cd0cdf6c13165

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 40decd518964dc237095c0fdb9a96a46fb2735d951baa368472f626ef3ad4c73
MD5 dffb6c4f0b659854c6534f09035c61d4
BLAKE2b-256 ac44a28bafb98cd09201eaea6ebb41180f29ee3a2c8ed6700477454f9caca468

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 353afea66e0a4cb1ce08841ee2a0ef0f4c8aaf368f8421d55b8051e598d72b08
MD5 c47be062004a48841cbacdf2357fcceb
BLAKE2b-256 580ddca100d6a501767340205bbde87201f033059fc911d0b374e41dcd266f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pymatio-0.2.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pymatio-0.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bd444aa32f4d55c74263e6914b4c5a779279e15152b83abc169fc57b2c41b4cf
MD5 1e418563ca3e17c96cedca1c5988cf3f
BLAKE2b-256 0ae65713354d348c71f894889ab441fdfa547c708331834b4c9ae60607f02d68

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 26055d51225dc40a25807d3d0600a209b3d10b29d1dfec89b2fbf8a7d6706740
MD5 92b1e4313b7820906eda88551c7876fb
BLAKE2b-256 94b9824b6ea8ed06e7759e9f3b1d414fdf5140a52851f5f6446dfe853b62e503

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp39-cp39-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 273782aac39b9ace378136eb692815a4dacb8e1d2f8d422de2d3194c8b0f0a07
MD5 f1a8c7fd32babedd3cfe413aa12f4265
BLAKE2b-256 113b7b661a1b3de4bdd901d7b8026f9e188d5e40af4df3eaad22c3104fb6becb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymatio-0.2.2-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on myuanz/pymatio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page