Skip to main content

nh5

nh5 is a Python package to support a new file format, .nh5, which stands for "not hdf5". This project aims to simplify and improve the loading of data in web applications, particularly for visualization purposes.

This package has an very small codebase. Feel free to explore!

See the accompanying JavaScript library.

Motivation behind nh5

The creation of this format was driven by specific challenges encountered with the hdf5 format, particularly in the context of web-based applications. While hdf5 is efficient for packaging large volumes of data, including data arrays, it falls short in terms of efficiency and ease when it comes to reading data from a web browser or from remote files. This inefficiency is primarily due to the scattered nature of metadata within the hdf5 file, necessitating multiple HTTP requests for access.

Simplified Data Access: Unlike hdf5, where metadata can be dispersed throughout the file, nh5 starts with a straightforward JSON text header. This header contains all the necessary attributes and metadata about the data arrays and can be loaded in one shot by the browser.

Predefined Data Structure: While hdf5 allows appending to an existing file, nh5 assumes that data is known in advance and needs to be packaged for visualization in web applications.

Installation

You can install nh5 using pip

pip install nh5

Usage

To convert an hdf5 file to an nh5 file, use the h5_to_nh5 function:

from nh5 import h5_to_nh5

h5_to_nh5("path_to_your_hdf5_file.h5", "path_for_the_output_nh5_file.nh5")

Limitations

  • Limited data types: Does not support all hdf5 data types.
  • No compression support: Currently, the nh5 format does not support data compression.

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Licensing

The code in this project is licensed under Apache License 2.0.

Author

The package and format were created by Jeremy Magland

Metadata

Release files for nh5 0.1.2

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

Source distribution (sdist)

Source distribution for nh5 0.1.2
File Size Uploaded
nh5-0.1.2.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nh5 0.1.2
File Interpreter ABI Platform
nh5-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.7 kB

Release files / nh5-0.1.2.tar.gz

Download URL nh5-0.1.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
869e61c2557a6ab47298ccdbaa078ec7b241839ff858ead6c9e80905995b75d9
BLAKE2b-256 checksum
How to use checksums
2d242720679cdfeeb6eb5d69b96f9ebaa009329c7672c50439737f8f3002218a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.9.18 Linux/6.5.6-76060506-generic

Release files / nh5-0.1.2-py3-none-any.whl

Download URL nh5-0.1.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af8fadbb488bd2d59238a668afaec28a9cdd3d426cb7c9afcc87b8090b0d95d2
BLAKE2b-256 checksum
How to use checksums
ff9d352b0c063626527a25415fd2f6ac89b7bb6b6299e8a0b272f5d0eca76cfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.9.18 Linux/6.5.6-76060506-generic

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 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