Skip to main content

FieldSet Export

DataFrame generation, CSV/HTML/chart export, and template rendering for numpy arrays and FieldSet containers.

pandas is optional — CSV, table, and chart exporters work with just numpy. Only StyledExporter requires pandas.

Installation

pip install vcti-fieldset-export>=1.0.0

With pandas support (for StyledExporter):

pip install vcti-fieldset-export[pandas]>=1.0.0

With all optional dependencies:

pip install vcti-fieldset-export[all]>=1.0.0

Quick Start

All exporters accept numpy arrays, dicts of numpy arrays, or pandas DataFrames.

CSV Export

import numpy as np
from vcti.fieldsetexport import CsvExporter

# From a dict of numpy arrays (no pandas needed)
CsvExporter({"stress": np.array([100, 200]), "disp": np.array([0.1, 0.2])}).export("output.csv")

# From a 2-D numpy array with field names
CsvExporter(np.array([[100, 0.1], [200, 0.2]]), field_names=["stress", "disp"]).export("output.csv")

# From a pandas DataFrame (requires pandas)
import pandas as pd
CsvExporter(pd.DataFrame({"stress": [100, 200], "disp": [0.1, 0.2]})).export("output.csv")

HTML Table (Tabulator)

from vcti.fieldsetexport import TableExporter

TableExporter({"stress": np.array([100, 200])}).export("output.html")

Styled HTML (requires pandas)

from vcti.fieldsetexport import StyledExporter

(
    StyledExporter({"stress": np.array([100, 200])})
    .set_caption("Results")
    .set_format(precision=2)
    .export_html("styled.html")
)

Interactive Chart

from vcti.fieldsetexport import ChartExporter, Trace, FigType, Fig

exporter = ChartExporter({"x": np.array([1, 2, 3])})
exporter.plot.title = "Stress vs Displacement"
exporter.plot.x_axis_title = "Index"
exporter.plot.y_axis_title = "Value"

fig = Fig(FigType.XY)
fig.add_trace(Trace("Stress", np.array([100, 200, 300]), color="blue"))
fig.add_trace(Trace("Displacement", np.array([0.1, 0.2, 0.3]), color="red"))
exporter.add_fig(fig)

exporter.export("chart.html")

Export Result and Dry-Run Validation

Every export() call returns an ExportResult with statistics:

result = CsvExporter({"stress": np.array([100, 200])}).export("output.csv")
print(result)  # ExportResult: 2 rows × 1 cols in 1.2ms, 34 bytes

# Dry-run: validate data + template without writing a file
result = CsvExporter(data).export("output.csv", validate_only=True)
assert result.dry_run is True

Error Handling

All export errors inherit from ExportError for easy catch-all handling:

from vcti.fieldsetexport import CsvExporter, ExportError, InvalidDataError

try:
    CsvExporter(data).export("output.csv")
except InvalidDataError as e:
    print(f"Bad data: {e}")       # empty array, wrong shape, etc.
except ExportError as e:
    print(f"Export failed: {e}")  # catches any export error

Exception hierarchy: ExportError > InvalidDataError, TemplateRenderError, FileWriteError.


Dependencies

Metadata

Release files for vcti-fieldset-export 1.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-fieldset-export 1.0.0
File Size Uploaded
vcti_fieldset_export-1.0.0.tar.gz 24.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vcti-fieldset-export 1.0.0
File Interpreter ABI Platform
vcti_fieldset_export-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.5 kB

Release files / vcti_fieldset_export-1.0.0.tar.gz

Download URL vcti_fieldset_export-1.0.0.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
477e0dab4ff327728871740d2281c9d6c1642c6730b50656dfe1e830266bd3da
BLAKE2b-256 checksum
How to use checksums
a9c0f521027f061d164f418df3398bfc84609afafe78e5fd3dfbf718f1d2db04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 29, 2026.

Transparency log

Release files / vcti_fieldset_export-1.0.0-py3-none-any.whl

Download URL vcti_fieldset_export-1.0.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d53ec033a452608471c02584aade3fea9340f73de382f6e6e3b67c8e69dfd21c
BLAKE2b-256 checksum
How to use checksums
0fa40872fd2d2cbfb18146ac1afd8fe62e9f6ca41882c21959e97ee684fe7da3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.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