CSV exporter plugin for vcti-tree-exporter: writes a vcti tree as a directory tree of CSV tables mirroring the hierarchy, with each node's attributes in a JSON sidecar.
Project description
CSV Tree Exporter
CSV exporter plugin for vcti-tree-exporter: writes a vcti tree as a directory tree of CSV tables.
CsvExporter serializes any vcti-tree
tree whose node payloads are
vcti-datanode DataNodes
as a directory of CSV tables mirroring the hierarchy, and ships a
get_exporter_descriptor() factory so a consumer registers it in a catalog and
resolves it by id ("csv") or by attribute lookup.
CSV suits light 2-D tables of settings and metadata that load straight into pandas — not heavy result arrays. Use HDF5 or NPZ for complete numeric data.
Tree → CSV mapping
The output path is a directory:
out/
_attributes.json # the root node's attributes
info.attributes.json # a metadata-only leaf -> sidecar only
materials/ # a group node -> sub-directory
props.csv # a structured-array leaf -> table with a header row
props.attributes.json # its attributes
vec.csv # a plain 1-D array -> one value per row
grid.csv # a plain 2-D array -> rows
| Tree node | On disk |
|---|---|
| node with children | sub-directory named after the node |
| data leaf | <name>.csv (structured → header + rows; plain 1-D/2-D → rows) |
a node's attributes |
<name>.attributes.json (leaf) or _attributes.json (group) |
| a group node's own array | _data.csv inside its directory |
Names are sanitized to filesystem-safe segments and de-collided case-insensitively
(Mat, mat → Mat, mat~1) so nothing is silently overwritten. An array with
more than two dimensions raises UnrepresentableNodeError. CSV does not preserve
dtype and the export is one-way.
Usage
from pathlib import Path
from vcti.tree.exporter.core import build_registry, get_exporter
from vcti.tree.exporter.csv import get_exporter_descriptor
registry = build_registry([get_exporter_descriptor()]) # plus any other format plugins
get_exporter(registry, "csv").export(tree, Path("out_dir"), overwrite=True)
overwrite=True replaces the existing output directory — point it at a
dedicated path.
Dependencies
- vcti-tree-exporter — the
Exporterprotocol and theExporterDescriptorcatalog. - vcti-tree / vcti-datanode — the tree and payload types.
- numpy. (CSV writing itself uses only the standard library.)
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_csv-2.0.0.tar.gz.
File metadata
- Download URL: vcti_tree_exporter_csv-2.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9017074583995028d8c9323467ef8d18131b87b45710c9f4938da7ec29fbc8e
|
|
| MD5 |
61f874b877c3dbc0542f80f4c5d16e81
|
|
| BLAKE2b-256 |
df96832310577a74ddcb8b6614de4878d9591336d5de51b4ea365344f9938da8
|
Provenance
The following attestation bundles were made for vcti_tree_exporter_csv-2.0.0.tar.gz:
Publisher:
release.yml on vcollab/vcti-python-tree-exporter-csv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_tree_exporter_csv-2.0.0.tar.gz -
Subject digest:
b9017074583995028d8c9323467ef8d18131b87b45710c9f4938da7ec29fbc8e - Sigstore transparency entry: 1983057014
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-tree-exporter-csv@2d9bb477918e3962e255ffd14dcbf8c215cf5226 -
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@2d9bb477918e3962e255ffd14dcbf8c215cf5226 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vcti_tree_exporter_csv-2.0.0-py3-none-any.whl.
File metadata
- Download URL: vcti_tree_exporter_csv-2.0.0-py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
57965fbaee3df30886f5d169e6c3425a20862ff80db070fffabe18ffc8c13442
|
|
| MD5 |
5f0074037f3001e0ebeb81b4b8a2588d
|
|
| BLAKE2b-256 |
40b4c0052b7d3fd2dfeea3d3227cd5cb895e5964ce98ff061dab79cb8ab2d189
|
Provenance
The following attestation bundles were made for vcti_tree_exporter_csv-2.0.0-py3-none-any.whl:
Publisher:
release.yml on vcollab/vcti-python-tree-exporter-csv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_tree_exporter_csv-2.0.0-py3-none-any.whl -
Subject digest:
57965fbaee3df30886f5d169e6c3425a20862ff80db070fffabe18ffc8c13442 - Sigstore transparency entry: 1983057071
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-tree-exporter-csv@2d9bb477918e3962e255ffd14dcbf8c215cf5226 -
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@2d9bb477918e3962e255ffd14dcbf8c215cf5226 -
Trigger Event:
push
-
Statement type: