HDF5 exporter plugin for vcti-tree-exporter: writes a vcti tree to an .h5 file (groups, datasets, attributes).
Project description
HDF5 Tree Exporter
HDF5 exporter plugin for vcti-tree-exporter: writes a vcti tree to an .h5 file (groups, datasets, attributes).
HdfExporter serializes any vcti-tree
tree whose node payloads are
vcti-datanode DataNodes
to a single HDF5 file. It satisfies the vcti.tree.exporter.core.Exporter protocol
and ships a get_exporter_descriptor() factory, so a consumer registers it in a
catalog and resolves it by id ("hdf5") or by attribute lookup.
Installation
pip install vcti-tree-exporter-hdf5
This pulls in vcti-tree-exporter (the protocol/catalog) and h5py.
Tree → HDF5 mapping
| Tree node | HDF5 object |
|---|---|
| internal node (has children) | HDF5 group |
data leaf (node.load() yields an array) |
HDF5 dataset (plain or, for a structured array, compound) |
| metadata-only leaf (no data, no children) | HDF5 group with attributes |
a node's node.name |
the group/dataset name (falls back to node_<index>) |
a node's node.attributes |
HDF5 attributes on the group/dataset |
A node's structural name comes from node.name (the vcti-datanode intrinsic),
and its free-form node.attributes are written verbatim — intrinsic identity
lives in its own namespace, so nothing needs filtering. NumPy Unicode (U<n>)
fields inside a compound dtype are stored as h5py variable-length UTF-8 strings
(h5py has no fixed-width Unicode in compound types). Attribute values are
coerced for h5py (bytes decoded, numpy scalars via .item()); anything h5py
can't store natively falls back to its str().
Usage
from pathlib import Path
from vcti.tree.exporter.core import build_registry, get_exporter
from vcti.tree.exporter.hdf5 import get_exporter_descriptor
registry = build_registry([get_exporter_descriptor()]) # plus any other format plugins
get_exporter(registry, "hdf5").export(tree, Path("model.h5"), overwrite=True)
Or use the exporter directly:
from vcti.tree.exporter.hdf5 import HdfExporter
HdfExporter().export(tree, Path("model.h5"))
Dependencies
- vcti-tree-exporter — the
Exporterprotocol and theExporterDescriptorcatalog. - vcti-tree / vcti-datanode — the tree and payload types.
- h5py — the HDF5 backend.
- numpy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vcti_tree_exporter_hdf5-2.0.0.tar.gz.
File metadata
- Download URL: vcti_tree_exporter_hdf5-2.0.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12f64fe7ae389198f91643a3462f7a4566e4d9e5c100d55062f5106ec0ca77ee
|
|
| MD5 |
7a0e67738c5c3138b5a48e5a16f5e626
|
|
| BLAKE2b-256 |
033d3b22948c6b9a9c540ddcadeb7d06ec015bb2116785d186b5e485ce0fa259
|
Provenance
The following attestation bundles were made for vcti_tree_exporter_hdf5-2.0.0.tar.gz:
Publisher:
release.yml on vcollab/vcti-python-tree-exporter-hdf5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_tree_exporter_hdf5-2.0.0.tar.gz -
Subject digest:
12f64fe7ae389198f91643a3462f7a4566e4d9e5c100d55062f5106ec0ca77ee - Sigstore transparency entry: 1983019535
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-tree-exporter-hdf5@bbd41c567a4edb8d99fbb2271b8b6c313c0676a5 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/vcollab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bbd41c567a4edb8d99fbb2271b8b6c313c0676a5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vcti_tree_exporter_hdf5-2.0.0-py3-none-any.whl.
File metadata
- Download URL: vcti_tree_exporter_hdf5-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8df45c7216793e65cd7dd787b69e77a1b8c492121c41b014a0111a61423351a
|
|
| MD5 |
65084c481adcc44c978412e19c507229
|
|
| BLAKE2b-256 |
1aff8d804edb5ad10def627bf074ce4167530ba461555035ccdf20e34d0797f6
|
Provenance
The following attestation bundles were made for vcti_tree_exporter_hdf5-2.0.0-py3-none-any.whl:
Publisher:
release.yml on vcollab/vcti-python-tree-exporter-hdf5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_tree_exporter_hdf5-2.0.0-py3-none-any.whl -
Subject digest:
c8df45c7216793e65cd7dd787b69e77a1b8c492121c41b014a0111a61423351a - Sigstore transparency entry: 1983019666
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-tree-exporter-hdf5@bbd41c567a4edb8d99fbb2271b8b6c313c0676a5 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/vcollab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bbd41c567a4edb8d99fbb2271b8b6c313c0676a5 -
Trigger Event:
push
-
Statement type: