{"id":19695387,"url":"https://github.com/readdy/h5rd","last_synced_at":"2025-06-19T06:34:27.761Z","repository":{"id":70998815,"uuid":"102366153","full_name":"readdy/h5rd","owner":"readdy","description":"lightweight hdf5 wrapper","archived":false,"fork":false,"pushed_at":"2021-09-02T09:27:23.000Z","size":110,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T12:45:14.089Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/readdy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-04T13:45:12.000Z","updated_at":"2021-09-02T09:27:26.000Z","dependencies_parsed_at":"2023-05-27T17:15:47.804Z","dependency_job_id":null,"html_url":"https://github.com/readdy/h5rd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/readdy/h5rd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readdy%2Fh5rd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readdy%2Fh5rd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readdy%2Fh5rd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readdy%2Fh5rd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/readdy","download_url":"https://codeload.github.com/readdy/h5rd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readdy%2Fh5rd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260702721,"owners_count":23049318,"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-11-11T19:27:39.739Z","updated_at":"2025-06-19T06:34:22.753Z","avatar_url":"https://github.com/readdy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# h5rd - a lightweight hdf5 wrapper\n\nh5rd provides c++11 (or later) header-only access to some of the functionality of hdf5. It supports\ncreating/opening groups, writing data sets of native or also array and compound types with the possibility\nto append and also generate VLEN data sets.\n\n## Dependencies\n- hdf5\n\n## Usage\n### Basic\n```cpp\nusing namespace h5rd;\n// create (and possibly overwrite) my_file.h5\nauto file = File::create(\"my_file.h5\");\n// create a group within that file alongside with its intermediates\nauto g = f-\u003ecreateGroup(\"/my/group/in/the/file\");\n// write strings\ng.write(\"string_dataset\", \"[insert something witty here]\");\n// write vectors of native types\n{\n  std::vector\u003cshort\u003e numbers {1., 2., 3., 4., 5., 6.};\n  g.write(\"numbers\", numbers);\n}\n// read back the vector\n{\n  std::vector\u003cshort\u003e numbers;\n  g.read(\"numbers\", numbers);\n}\n```\n### Compound types, appending to data sets\n```cpp\nusing namespace h5rd;\n// create (and possibly overwrite) my_file.h5\nauto file = File::create(\"my_file.h5\");\n// create a group within that file alongside with its intermediates\nauto g = f-\u003ecreateGroup(\"/my/group/in/the/file\");\n// define a compound type\nstruct Stuff {\n  int a;\n  float x;\n  std::array\u003cshort, 3\u003e xyz;\n}\nNativeCompoundType nct = NativeCompoundTypeBuilder(sizeof(Stuff), f-\u003eref())\n  .insert\u003cdecltype(std::declval\u003cStuff\u003e().a)\u003e(\"a\", offsetof(Stuff, a))\n  .insert\u003cdecltype(std::declval\u003cStuff\u003e().x)\u003e(\"x\", offsetof(Stuff, x))\n  .insertStdArray\u003cdecltype(std::declval\u003cStuff\u003e().xyz)\u003e(\"xyz\", offsetof(Stuff, xyz))\n  .build();\nSTDCompoundType sct (nct);\n// create an 1D extensible data (chunk size 3) set with this type,\n// add a compression filter\nNBITFilter filter;\nauto ds = group.createDataSet(\"stuff\", {3}, {UNLIMITED_DIMS}, nct, sct, {\u0026filter});\n{\n  Stuff s1{3, 5.f, {{1, 1, 1}}};\n  Stuff s2{4, 5.f, {{2, 2, 2}}};\n  Stuff s3{6, 7.f, {{3, 3, 3}}};\n  std::vector\u003cStuff\u003e stuffs{s1, s2, s3};\n  // append twice\n  ds-\u003eappend({stuffs.size()}, stuffs.data());\n  ds-\u003eappend({stuffs.size()}, stuffs.data());\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freaddy%2Fh5rd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freaddy%2Fh5rd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freaddy%2Fh5rd/lists"}