{"id":13629661,"url":"https://github.com/Apollo3zehn/PureHDF","last_synced_at":"2025-04-17T09:35:35.394Z","repository":{"id":65645234,"uuid":"593247355","full_name":"Apollo3zehn/PureHDF","owner":"Apollo3zehn","description":"A pure .NET library that makes reading and writing of HDF5 files (groups, datasets, attributes, ...) very easy. ","archived":false,"fork":false,"pushed_at":"2024-10-01T20:33:42.000Z","size":9882,"stargazers_count":55,"open_issues_count":41,"forks_count":18,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2024-11-07T17:11:57.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Apollo3zehn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T15:22:42.000Z","updated_at":"2024-11-05T10:10:38.000Z","dependencies_parsed_at":"2024-03-08T21:22:14.564Z","dependency_job_id":"918db866-f1aa-4f98-912d-ede3e421beaa","html_url":"https://github.com/Apollo3zehn/PureHDF","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo3zehn%2FPureHDF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo3zehn%2FPureHDF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo3zehn%2FPureHDF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apollo3zehn%2FPureHDF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apollo3zehn","download_url":"https://codeload.github.com/Apollo3zehn/PureHDF/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223751349,"owners_count":17196619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:01:15.963Z","updated_at":"2024-11-08T20:31:38.324Z","avatar_url":"https://github.com/Apollo3zehn.png","language":"C#","funding_links":[],"categories":["Do not want to test 112 ( old ISourceGenerator )"],"sub_categories":["1. [ThisAssembly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ThisAssembly) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category"],"readme":"# PureHDF\n\n[![GitHub Actions](https://github.com/Apollo3zehn/PureHDF/actions/workflows/build-and-publish.yml/badge.svg?branch=master)](https://github.com/Apollo3zehn/PureHDF/actions) [![NuGet](https://img.shields.io/nuget/vpre/PureHDF.svg?label=Nuget)](https://www.nuget.org/packages/PureHDF)\n\nA pure C# library without native dependencies that makes reading and writing of HDF5 files (groups, datasets, attributes, ...) very easy.\n\nThis library runs on all platforms (ARM, x86, x64) and operating systems (Linux, Windows, MacOS, Raspbian, etc) that are supported by the .NET ecosystem without special configuration.\n\nThe implemention follows the [HDF5 File Format Specification (HDF5 1.10)](https://docs.hdfgroup.org/hdf5/v1_10/_f_m_t3.html).\n\n\u003e Please read the [docs](https://apollo3zehn.github.io/PureHDF/) for samples and API documentation.\n\n# Version 1\n\nThe minimum supported target framework is .NET Standard 2.0 which includes\n- `.NET Framework 4.6.1+`\n- `.NET Core (all versions)`\n- `.NET 5+`\n\nVersion 1 of PureHDF supports all .NET versions starting with `.NET 4.7.2` and continues to receive bug fixes. Features will be backported upon request if feasible.\n\n# Version 2\n\nThe minimum supported target framework version is `.NET 6.0+`.\n\nTo keep the code base clean, version 2 of PureHDF targets [active .NET versions](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core) only, which are `.NET 6` and `.NET 8` as of now (August 2024).\n\n# Installation\n\n```bash\ndotnet add package PureHDF\n```\n\n# Quick Start\n\n## Reading\n\n```cs\n// root group\nvar file = H5File.OpenRead(\"path/to/file.h5\");\n\n// sub group\nvar group = file.Group(\"path/to/group\");\n\n// attribute\nvar attribute = group.Attribute(\"my-attribute\");\nvar attributeData = attribute.Read\u003cint\u003e();\n\n// dataset\nvar dataset = group.Dataset(\"my-dataset\");\nvar datasetData = dataset.Read\u003cdouble\u003e();\n```\n\nSee the [docs](https://apollo3zehn.github.io/PureHDF/reading/index.html) to learn more about `data types`, `multidimensional arrays`, `chunks`, `compression`, `slicing` and more.\n\n## Writing\n\nThe first step is to create a new `H5File` instance:\n\n```cs\nvar file = new H5File();\n```\n\nA `H5File` derives from the `H5Group` type because it represents the root group. `H5Group` implements the `IDictionary` interface, where the keys represent the links in an HDF5 file and the value determines the type of the link: either it is another `H5Group` or a `H5Dataset`. \n\nYou can create an empty group like this:\n\n```cs\nvar group = new H5Group();\n```\n\nIf the group should have some datasets, just add them using the dictionary collection initializer - just like with a normal dictionary:\n\n```cs\nvar group = new H5Group()\n{\n    [\"numerical-dataset\"] = new double[] { 2.0, 3.1, 4.2 },\n    [\"string-dataset\"] = new string[] { \"One\", \"Two\", \"Three\" }\n}\n```\n\nDatasets and attributes can both be created either by instantiating their specific class (`H5Dataset`, `H5Attribute`) or by just providing some kind of data. This data can be nearly anything: arrays, scalars, numerical values, strings, anonymous types, enums, complex objects, structs, bool values, etc. However, whenever you want to provide more details like the dimensionality of the attribute or dataset, the chunk layout or the filters to be applied to a dataset, you need to instantiate the appropriate class.\n\nBut first, let's see how to add attributes. Attributes cannot be added directly using the dictionary collection initializer because that is only for datasets. However, every `H5Group` has an `Attribute` property which accepts our attributes:\n\n```cs\nvar group = new H5Group()\n{\n    Attributes = new()\n    {\n        [\"numerical-attribute\"] = new double[] { 2.0, 3.1, 4.2 },\n        [\"string-attribute\"] = new string[] { \"One\", \"Two\", \"Three\" }\n    }\n}\n```\n\nThe full example with the root group, a subgroup, two datasets and two attributes looks like this:\n\n```cs\nvar file = new H5File()\n{\n    [\"my-group\"] = new H5Group()\n    {\n        [\"numerical-dataset\"] = new double[] { 2.0, 3.1, 4.2 },\n        [\"string-dataset\"] = new string[] { \"One\", \"Two\", \"Three\" },\n        Attributes = new()\n        {\n            [\"numerical-attribute\"] = new double[] { 2.0, 3.1, 4.2 },\n            [\"string-attribute\"] = new string[] { \"One\", \"Two\", \"Three\" }\n        }\n    }\n};\n```\n\nThe last step is to write the defined file to the drive:\n\n```cs\nfile.Write(\"path/to/file.h5\");\n```\n\nSee the [docs](https://apollo3zehn.github.io/PureHDF/writing/index.html) to learn more about `data types`, `multidimensional arrays`, `chunks`, `compression`, `slicing` and more.\n\n# Development\n\nThe tests of PureHDF are executed against `.NET 6` and `.NET 8` so these two runtimes are required. Please note that due to an currently unknown reason the writing tests cannot be run in parallel to other tests because some unrelated temp files are in use although they should not be and thus cannot be accessed by the unit tests.\n\nIf you are using Visual Studio Code as your IDE, you can simply execute one of the predefined test tasks by selecting `Run Tasks` from the global menu (`Ctrl+Shift+P`). The following test tasks are predefined:\n\n- `tests: common`\n- `tests: writing`\n- `tests: filters`\n- `tests: HSDS`\n\nThe HSDS tests require a python installation to be present on the system with the `venv` package available.\n\n# Comparison Table\nOverwhelmed by the number of different HDF 5 libraries? Here is a comparison table:\n\n\u003e Note: The following table considers only projects listed on Nuget.org\n\n|         Name                                                                      | Arch    | Platform    | Kind     | Mode | Version   | License     | Maintainer         | Comment              |  \n| --------------------------------------------------------------------------------- | ------- | ----------- | -------- | ---- | --------- | ----------- | ------------------ | -------------------- |  \n| **v1.10**                                                                         |         |             |          |      |           |             |                    |                      |  \n| [PureHDF](https://www.nuget.org/packages/PureHDF)                                 | all     | all         | managed  | rw   | 1.10.*    | MIT         | Apollo3zehn        |                      |\n| [HDF5-CSharp](https://www.nuget.org/packages/HDF5-CSharp)                         | x86,x64 | Win,Lin,Mac | HL       | rw   | 1.10.6    | MIT         | LiorBanai          |                      |  \n| [SciSharp.Keras.HDF5](https://www.nuget.org/packages/SciSharp.Keras.HDF5)         | x86,x64 | Win,Lin,Mac | HL       | rw   | 1.10.5    | MIT         | SciSharp           | fork of HDF-CSharp   |  \n| [ILNumerics.IO.HDF5](https://www.nuget.org/packages/ILNumerics.IO.HDF5)           | x64     | Win,Lin     | HL       | rw   | ?         | proprietary | IL\\_Numerics\\_GmbH | probably 1.10        |  \n| [LiteHDF](https://www.nuget.org/packages/LiteHDF)                                 | x86,x64 | Win,Lin,Mac | HL       | ro   | 1.10.5    | MIT         | silkfire           |                      |  \n| [hdflib](https://www.nuget.org/packages/hdflib)                                   | x86,x64 | Windows     | HL       | wo   | 1.10.6    | MIT         | bdebree            |                      |  \n| [Mbc.Hdf5Utils](https://www.nuget.org/packages/Mbc.Hdf5Utils)                     | x86,x64 | Win,Lin,Mac | HL       | rw   | 1.10.6    | Apache-2.0  | bqstony            |                      |  \n| [HDF.PInvoke](https://www.nuget.org/packages/HDF.PInvoke)                         | x86,x64 | Windows     | bindings | rw   | 1.8,1.10.6| HDF5        | hdf,gheber         |                      |  \n| [HDF.PInvoke.1.10](https://www.nuget.org/packages/HDF.PInvoke.1.10)               | x86,x64 | Win,Lin,Mac | bindings | rw   | 1.10.6    | HDF5        | hdf,Apollo3zehn    |                      |  \n| [HDF.PInvoke.NETStandard](https://www.nuget.org/packages/HDF.PInvoke.NETStandard) | x86,x64 | Win,Lin,Mac | bindings | rw   | 1.10.5    | HDF5        | surban             |                      |  \n| **v1.8**                                                                          |         |             |          |      |           |             |                    |                      |  \n| [HDF5DotNet.x64](https://www.nuget.org/packages/HDF5DotNet.x64)                   | x64     | Windows     | HL       | rw   | 1.8       | HDF5        | thieum             |                      |  \n| [HDF5DotNet.x86](https://www.nuget.org/packages/HDF5DotNet.x86)                   | x86     | Windows     | HL       | rw   | 1.8       | HDF5        | thieum             |                      |  \n| [sharpHDF](https://www.nuget.org/packages/sharpHDF)                               | x64     | Windows     | HL       | rw   | 1.8       | MIT         | bengecko           |                      |  \n| [HDF.PInvoke](https://www.nuget.org/packages/HDF.PInvoke)                         | x86,x64 | Windows     | bindings | rw   | 1.8,1.10.6| HDF5        | hdf,gheber         |                      |  \n| [hdf5-v120-complete](https://www.nuget.org/packages/hdf5-v120-complete)           | x86,x64 | Windows     | native   | rw   | 1.8       | HDF5        | daniel.gracia      |                      |  \n| [hdf5-v120](https://www.nuget.org/packages/hdf5-v120)                             | x86,x64 | Windows     | native   | rw   | 1.8       | HDF5        | keen               |                      |  \n\n**Abbreviations:**\n\n| Term      | .NET API   | Native dependencies |\n| --------- | ---------- | ------------------- |\n| `managed` | high-level | none                |\n| `HL`      | high-level | C-library           |\n| `bindings`| low-level  | C-library           |\n| `native`  | none       | C-library           |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FApollo3zehn%2FPureHDF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FApollo3zehn%2FPureHDF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FApollo3zehn%2FPureHDF/lists"}