nh5


Namenh5 JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/magland/nh5
SummaryUtilities to support the nh5 file format
upload_time2024-01-17 23:00:42
maintainer
docs_urlNone
authorJeremy Magland
requires_python>=3.9,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/magland/nh5/tree/main/js).

## 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

```bash
pip install nh5
```

## Usage

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

```python
from nh5 import h5_to_nh5

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

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

```python
from nh5 import nh5_to_h5

nh5_to_h5("path_to_your_nh5_file.nh5", "path_for_the_output_hdf5_file.h5")
```

## 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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/magland/nh5",
    "name": "nh5",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jeremy Magland",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/90/c6/c7de43ae609c74dacb212480948f8430077fb3b7621b414542817fa3a6ee/nh5-0.1.3.tar.gz",
    "platform": null,
    "description": "# nh5\n\n`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.\n\nThis package has an *very small* codebase. Feel free to explore!\n\nSee the [accompanying JavaScript library](https://github.com/magland/nh5/tree/main/js).\n\n## Motivation behind nh5\n\nThe 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.\n\n**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.\n\n**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.\n\n## Installation\n\nYou can install nh5 using pip\n\n```bash\npip install nh5\n```\n\n## Usage\n\nTo convert an hdf5 file to an nh5 file, use the h5_to_nh5 function:\n\n```python\nfrom nh5 import h5_to_nh5\n\nh5_to_nh5(\"path_to_your_hdf5_file.h5\", \"path_for_the_output_nh5_file.nh5\")\n```\n\nTo convert an nh5 file to an hdf5 file, use the nh5_to_h5 function:\n\n```python\nfrom nh5 import nh5_to_h5\n\nnh5_to_h5(\"path_to_your_nh5_file.nh5\", \"path_for_the_output_hdf5_file.h5\")\n```\n\n## Limitations\n\n- Limited data types: Does not support all hdf5 data types.\n- No compression support: Currently, the nh5 format does not support data compression.\n\n## Contributing\n\nContributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.\n\n## Licensing\n\nThe code in this project is licensed under Apache License 2.0.\n\n## Author\n\nThe package and format were created by Jeremy Magland\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Utilities to support the nh5 file format",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/magland/nh5",
        "Repository": "https://github.com/magland/nh5"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f739aa4093b7468349ec64b22c4184c914f5ecbe6902bd9936b5f92442fb31f",
                "md5": "8c232a5b93b70e9ac44489755f86cfeb",
                "sha256": "261366c6b5e152f452245e0e8f0cf1cf5739c528102b163c0f43ba8d5b6ceaea"
            },
            "downloads": -1,
            "filename": "nh5-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8c232a5b93b70e9ac44489755f86cfeb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 8665,
            "upload_time": "2024-01-17T23:00:41",
            "upload_time_iso_8601": "2024-01-17T23:00:41.568752Z",
            "url": "https://files.pythonhosted.org/packages/3f/73/9aa4093b7468349ec64b22c4184c914f5ecbe6902bd9936b5f92442fb31f/nh5-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "90c6c7de43ae609c74dacb212480948f8430077fb3b7621b414542817fa3a6ee",
                "md5": "01839a9f01cea6dfdbdb0fb705ba07f0",
                "sha256": "a29c2b5a5a2eb5badca01a2d98071bf5119bca3866bffbb89e49c162c6d017cc"
            },
            "downloads": -1,
            "filename": "nh5-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "01839a9f01cea6dfdbdb0fb705ba07f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 7972,
            "upload_time": "2024-01-17T23:00:42",
            "upload_time_iso_8601": "2024-01-17T23:00:42.627341Z",
            "url": "https://files.pythonhosted.org/packages/90/c6/c7de43ae609c74dacb212480948f8430077fb3b7621b414542817fa3a6ee/nh5-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 23:00:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "magland",
    "github_project": "nh5",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nh5"
}
        
Elapsed time: 0.20003s