h5py
Read and write HDF5 files from Python
Decision gist · record as of 2026-08-14
Yes. h5py is a mature, actively maintained library (production-stable since 2014, last commit 2026-08-07) with no known vulnerabilities, broad platform support via pre-built wheels, and a single lightweight dependency on NumPy. Install it if you work with scientific data, need portable binary storage, or must interoperate with HDF5 files from other tools or languages.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires HDF5 library; pre-built wheels include it, but building from source requires HDF5 1.10.4 or later.
- Medium install friction due to compiled dependencies, but wheels are pre-built for common platforms (macOS, Linux, Windows across multiple architectures).
- Active maintenance with recent commits and stable production status.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you can use, modify, and distribute h5py with minimal restrictions, provided you include the license notice.
last release 2026-03-06 (161 days) · last repo commit 2026-08-07 · 2,247 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 45,760,485 downloads/mo, #615 on PyPI
Alternatives
Verify before relying
pip install h5py
import h5py
import numpy as np
with h5py.File('data.h5', 'w') as f:
f.create_dataset('mydata', data=np.array([1, 2, 3]))- Performance characteristics for very large datasets or concurrent access patterns
- Compatibility with HDF5 versions released after this h5py version
What it is and what it does
h5py is a Python interface to the HDF5 binary data format, a widely-used standard for storing and managing large, complex scientific and engineering datasets. It bridges the gap between Python's data ecosystem and HDF5 by automatically converting between NumPy arrays and HDF5 datasets, and between Python dictionaries and HDF5 groups, so you can read and write hierarchical data with minimal boilerplate.
The package offers both a complete low-level API wrapping the underlying HDF5 C library and a high-level Pythonic interface. Pre-built wheels for macOS, Linux, and Windows include a bundled HDF5 library, making installation straightforward on common platforms; you can also build from source against your own HDF5 installation. It depends only on NumPy and is actively maintained with support for current Python versions.
Use it for
- Store and retrieve large NumPy arrays in a structured, hierarchical format without converting to text or pickle.
- Organize scientific experiment data into groups and subgroups, mirroring the logical structure of your analysis.
- Share binary data files across platforms and programming languages via the HDF5 standard.
- Access specific datasets within a file without loading the entire file into memory.
- Persist complex nested data structures (arrays, metadata, groups) in a single portable file.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
h5py is a mature, actively maintained library (production-stable since 2014, last commit 2026-08-07) with no known vulnerabilities, broad platform support via pre-built wheels, and a single lightweight dependency on NumPy. Install it if you work with scientific data, need portable binary storage, or must interoperate with HDF5 files from other tools or languages.
Install
h5py on PyPI
Before you install
Medium install friction due to compiled dependencies, but wheels are pre-built for common platforms (macOS, Linux, Windows across multiple architectures). Active maintenance with recent commits and stable production status.
Requires HDF5 library; pre-built wheels include it, but building from source requires HDF5 1.10.4 or later.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute h5py with minimal restrictions, provided you include the license notice.
Quickstart
pip install h5py
import h5py
import numpy as np
with h5py.File('data.h5', 'w') as f:
f.create_dataset('mydata', data=np.array([1, 2, 3]))
Verify before relying
- Performance characteristics for very large datasets or concurrent access patterns
- Compatibility with HDF5 versions released after this h5py version
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 161 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 45,760,485 / month, #615 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 1 - UnstableProgramming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Scientific/EngineeringTopic :: Software Development :: Libraries :: Python Modules |
Evidence: h5py-3.16.0-cp310-cp310-macosx_10_9_x86_64.whl; h5py-3.16.0-cp310-cp310-macosx_11_0_arm64.whl; h5py-3.16.0-cp310-cp310-manylinux_2_28_aarch64.whl; h5py-3.16.0-cp310-cp310-manylinux_2_28_x86_64.whl; h5py-3.16.0-cp310-cp310-musllinux_1_2_aarch64.whl; h5py-3.16.0-cp310-cp310-musllinux_1_2_x86_64.whl; h5py-3.16.0-cp310-cp310-win_amd64.whl; h5py-3.16.0-cp311-cp311-macosx_10_9_x86_64.whl; h5py-3.16.0-cp311-cp311-macosx_11_0_arm64.whl; h5py-3.16.0-cp311-cp311-manylinux_2_28_aarch64.whl; h5py-3.16.0-cp311-cp311-manylinux_2_28_x86_64.whl; h5py-3.16.0-cp311-cp311-musllinux_1_2_aarch64.whl; h5py-3.16.0-cp311-cp311-musllinux_1_2_x86_64.whl; h5py-3.16.0-cp311-cp311-win_amd64.whl; h5py-3.16.0-cp311-cp311-win_arm64.whl; h5py-3.16.0-cp312-cp312-macosx_10_13_x86_64.whl; h5py-3.16.0-cp312-cp312-macosx_11_0_arm64.whl; h5py-3.16.0-cp312-cp312-manylinux_2_28_aarch64.whl; h5py-3.16.0-cp312-cp312-manylinux_2_28_x86_64.whl; h5py-3.16.0-cp312-cp312-musllinux_1_2_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “HDF5 file reading writing”
- h5pyh5py reads and writes HDF5 files from Python, providing both…
- netCDF4netcdf4 provides a Python interface to read, write, and manipulate…
- h5netcdfh5netcdf reads and writes netCDF4 files using h5py or h5pyd backends,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also h5grove · h5netcdf · hickle · tables · mat73 · geoh5py · netCDF4 · pymatreader · kerchunk · rosettasciio