skillfed

h5netcdf

netCDF4 via h5py

h5netcdf v1.8.1 5.2M downloads/30d#2,146 on PyPI227
Permissive license Copyright (c) 2015, h5netcdf developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are… (full text in the JSON record) Active released

What it is and what it does

h5netcdf is a Python interface to the netCDF4 file format that reads and writes HDF5 files directly via h5py, h5pyd, or the pure-Python Pyfive backend, without requiring the Unidata netCDF C library. It offers two APIs: a modern hierarchical interface modeled on h5py, and a legacy API designed for compatibility with netCDF4-python. The package supports both NETCDF4 and NETCDF4_CLASSIC formats, unlimited dimensions, groups, and hierarchical variable access.

The main appeal is reduced installation friction—if you already have h5py, reading netCDF4 files may be simpler than installing netCDF4-python and its C dependencies. It also provides a pure-Python reading path via Pyfive, useful in restricted or hard-to-build environments. The package has been in active development since 2015 and is marked production-stable, with support for Python 3.9 through 3.14.

Use it for:

  • Read and write netCDF4 files in environments where the Unidata netCDF C library is difficult or impossible to install.
  • Access HDF5 data via the netCDF4 interface when you already have h5py installed, avoiding duplicate binary dependencies.
  • Use the pure-Python Pyfive backend to read netCDF files in restricted or containerized environments without C compilation.
  • Migrate from netCDF4-python to h5netcdf using the legacy API for drop-in compatibility with minimal code changes.
  • Work with hierarchical netCDF data using the modern API's h5py-like syntax for direct group and variable access.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

h5netcdf reads and writes netCDF4 files using h5py or h5pyd backends, bypassing the Unidata netCDF C library and offering an alternative interface to netCDF4-python with optional pure-Python support via Pyfive.

Yes. h5netcdf is production-stable, actively maintained, has low install friction, no known vulnerabilities, and a permissive license. Install it if you need netCDF4 support without the Unidata C library, or if you want a pure-Python reading option. The legacy API makes it a low-risk alternative to netCDF4-python for existing code.

Install

h5netcdf on PyPI

pip

pip install h5netcdf

uv

uv add h5netcdf

poetry

poetry add h5netcdf

Installing h5netcdf

Before you install

Low friction: pure Python wheel with only packaging and numpy as runtime dependencies. Actively maintained with recent commits and production-stable status. Optional extras (h5py, h5pyd, pyfive) can be installed separately to avoid forcing a specific HDF5 backend.

License in practice

BSD 3-Clause permissive license allows commercial and private use with minimal restrictions—retain copyright notice and disclaimer in distributions.

Quickstart

pip install h5netcdf[h5py]

import h5netcdf
import numpy as np

with h5netcdf.File("mydata.nc", "w") as f:
    f.dimensions = {"x": 5}
    v = f.create_variable("hello", ("x",), float)
    v[:] = np.ones(5)

Requires h5py (version 3.0+) or h5pyd installed separately; pure-Python Pyfive backend available but optional.

Verify before relying

  • Whether the reported 4x performance improvement over netCDF4-python holds for typical workflows beyond the single cited case.
  • Current state of unsupported netCDF operations (rename, delete) and whether patches have been accepted since publication.

Package facts

License Copyright (c) 2015, h5netcdf developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — packaging, numpy
Maintenance actively maintained — 203 days since the last release
Last repo commit
First released
Downloads 5,183,537/month — #2,146 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: h5netcdf-1.8.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming 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 :: 3.9Topic :: Scientific/Engineering

Tags

netcdf4 file reader writerhdf5 netcdf interfaceh5py netcdf wrapperscientific data format pythonnetcdf without c libraryhdf5 hierarchical data
hdf5-netcdfscientific-datafile-format

More Scientific/Engineering packages