root_mcp.core.io.exporters module

Data export functionality for ROOT files.

class root_mcp.core.io.exporters.DataExporter(config)[source]

Bases: object

Export TTree data to various formats.

Supports JSON, CSV, and Parquet exports with compression options.

Parameters:

config (Config)

__init__(config)[source]

Initialize data exporter.

Parameters:

config (Config) – Server configuration

export(data, output_path, format, **kwargs)[source]

Export data to specified format.

Parameters:
  • data (awkward.Array) – Awkward array data

  • output_path (str | Path) – Output file path

  • format (str) – Export format (json, csv, parquet)

  • **kwargs (Any) – Format-specific options

Returns:

Export metadata

Raises:

ValueError – If format is not supported

Return type:

dict[str, Any]

export_to_csv(data, output_path, compress=False)[source]

Export data to CSV format.

Parameters:
  • data (awkward.Array) – Awkward array data

  • output_path (str | Path) – Output file path

  • compress (bool) – Whether to compress output

Returns:

Export metadata

Return type:

dict[str, Any]

export_to_json(data, output_path, compress=False)[source]

Export data to JSON format.

Parameters:
  • data (awkward.Array) – Awkward array data

  • output_path (str | Path) – Output file path

  • compress (bool) – Whether to compress output

Returns:

Export metadata

Return type:

dict[str, Any]

export_to_parquet(data, output_path, compression='snappy')[source]

Export data to Parquet format.

Parameters:
  • data (awkward.Array) – Awkward array data

  • output_path (str | Path) – Output file path

  • compression (str) – Compression algorithm (snappy, gzip, brotli, none)

Returns:

Export metadata

Return type:

dict[str, Any]