# What changed in h5py

> 46 changes in h5py 3 from its official release notes, upgrade guides and advisories: 21 breaking, 12 new APIs and options. Each one cited. Sources checked 2026-10-30. HTML: https://unstale.sh/pypi/h5py/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## h5py 3

### Breaking changes

- The deprecated property was removed; use ds[()] to read all data from any dataset. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The broken inherited method was removed because the dimensions interface behaves as a sequence, not a mapping. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The broken inherited method was removed because the dimensions interface behaves as a sequence, not a mapping. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The default mode for opening files is now read-only; specify another mode if you need to write. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated attribute was removed; use File.id instead. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated function was removed; see the newer APIs for special types. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated function was removed; see the newer APIs for special types. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Creating a dataset from a list of bytes objects now uses a variable-length string datatype; use h5py.string_dtype() for fixed-length strings. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The external argument accepts any iterable as its top-level container, bytes or os.PathLike file names, and NumPy integer offsets and sizes; some previous forms are no longer accepted. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Its third argument is now an optional high-level Dataset object rather than a DatasetID. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated dictionary was removed. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated module was removed; the high-level API is available directly in the h5py module. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- MPI mode no longer supports mpi4py 1.x. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated function was removed; see the newer APIs for special types. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The deprecated function was removed; see the newer APIs for special types. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- h5py now requires Python 3.6 or above and is no longer compatible with Python 2.7. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The command was removed; build configuration can be specified with environment variables instead. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The interface and rules for storing and reading strings have changed and may require changes to existing h5py code. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Variable-length UTF-8 strings in datasets are now read as bytes by default instead of str. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Relative paths are now used for virtual data sources when the source dataset is in the same file as the virtual dataset. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- A dtype must now be specified when making a virtual dataset; there is no longer a default dtype. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)

### New APIs and options

- Reads only selected fields from a dataset with a compound datatype. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Iterates over chunks within the given selection. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Provides the size of a dataset’s data in bytes, unlike size, which gives the number of elements. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- File creation now supports setting the file space strategy, including an option to persist empty space tracking between sessions. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The low-level chunk query API provides information about dataset chunks in an HDF5 file. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The low-level chunk query API provides information about dataset chunks in an HDF5 file. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The low-level chunk query API provides information about dataset chunks in an HDF5 file. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Adds allow_unknown_filter for data that will be compressed before writing with the low-level write_direct_chunk() method. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Use a suitable dtype from this API to store fixed-length strings. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Can now be stored and read as HDF5 opaque data, though other tools will not understand them. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Methods accepting a shape tuple, such as dataset creation, now also accept an integer for a 1D shape. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- h5py now supports the split file driver. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)

### Performance

- Selection is implemented in Cython, reducing reading overhead; many small reads from the same dataset can be as much as 10 times faster. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Reading and writing release the GIL so another Python thread can continue during HDF5 access; HDF5’s global lock still prevents faster parallel data access with multithreading. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Writing is more efficient when assigning a scalar to a chunked dataset if the number of elements written is no more than one chunk. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)

### Behavior and default changes

- Casting data to a specified type on reading can now be used without a with statement. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Now works for any file driver that supports it, not only the sec2 driver. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Virtual datasets can now grow as their source data is resized. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)

### Fixes and other changes

- obj.attrs can now work on HDF5 stored datatypes. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The property now handles SWMR access modes in addition to plain RDONLY and RDWR modes. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- The property is now always available. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Fixed a bug when the source is a high-level object and the destination is a Group. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- Now reports storage size of zero bytes without raising an exception. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- h5py is now compatible with HDF5 1.12. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
- When built against HDF5 1.10.6, h5py uses UTF-8 for file names on Windows, allowing all filenames. (3.0.0) — [upgrade guide](https://docs.h5py.org/en/latest/whatsnew/3.0.html)
