Skip to main content

JSON Tree Exporter

JSON exporter plugin for vcti-tree-exporter: writes a vcti tree to a single .json document.

JsonExporter serializes any vcti-tree tree whose node payloads are vcti-datanode DataNodes to one JSON document that mirrors the tree, and ships a get_exporter_descriptor() factory so a consumer registers it in a catalog and resolves it by id ("json") or by attribute lookup.

JSON is a natural fit for structure, metadata, and light arrays — simulation settings, CAE metadata, input decks — that load straight into tooling. It is a poor fit for large numeric arrays (they become bulky nested lists); use HDF5 or NPZ for heavy data.

Installation

pip install vcti-tree-exporter-json

This pulls in vcti-tree-exporter (the protocol/catalog) and numpy.

Tree → JSON mapping

Each node becomes an object; the document root is the tree's root node:

{
  "name": "model",
  "attributes": {"solver": "abaqus"},
  "children": [
    {"name": "info", "attributes": {"count": 7}},
    {"name": "displacement", "attributes": {}, "data": [1.0, 2.0, 3.0]}
  ]
}
Tree node part JSON
node.name "name" (the structural name; null if unset)
node.attributes "attributes" object (always present)
node.load() array "data" as nested lists (present only for data nodes)
children "children" array (present only when non-empty)

A node may carry both data and children. Attribute values are JSON-encoded (bytes decoded, numpy scalars/arrays converted to numbers/lists); anything not natively serializable falls back to its str(). Array dtype is not preserved — the export is one-way.

Usage

from pathlib import Path
from vcti.tree.exporter.core import build_registry, get_exporter
from vcti.tree.exporter.json import get_exporter_descriptor

registry = build_registry([get_exporter_descriptor()])   # plus any other format plugins
get_exporter(registry, "json").export(tree, Path("model.json"), overwrite=True)

Or use the exporter directly:

from vcti.tree.exporter.json import JsonExporter
JsonExporter().export(tree, Path("model.json"))

Dependencies

  • vcti-tree-exporter — the Exporter protocol and the ExporterDescriptor catalog.
  • vcti-tree / vcti-datanode — the tree and payload types.
  • numpy. (JSON encoding itself uses only the standard library.)

Metadata

Release files for vcti-tree-exporter-json 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vcti-tree-exporter-json 2.0.0
File Size Uploaded
vcti_tree_exporter_json-2.0.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vcti-tree-exporter-json 2.0.0
File Interpreter ABI Platform
vcti_tree_exporter_json-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / vcti_tree_exporter_json-2.0.0.tar.gz

Download URL vcti_tree_exporter_json-2.0.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
60b06e8e4c626424c0f122675623b9fb0e2e4fbb74fadb62168bb741835c4893
BLAKE2b-256 checksum
How to use checksums
cff72c71bf2d206d4d48b90681862d3b8ef376df58060b41be5988b8b77133a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.

Transparency log

Release files / vcti_tree_exporter_json-2.0.0-py3-none-any.whl

Download URL vcti_tree_exporter_json-2.0.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4090952cbafb30194e8c31407d4be96a236681c68794ffb8e81cee7814923bd0
BLAKE2b-256 checksum
How to use checksums
02608e99ffb4fc5bf8093eff9db2bab522dd5bf26c9a79cc82c0d7e3a829355d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page