Skip to content

bagx.export

bagx.export

Export rosbag data to AI/analytics-friendly formats (JSON, Parquet).

export_bag(bag_path, output_dir, fmt='parquet', topics=None, flatten=True, ai_mode=False)

Export bag data to structured files, one per topic.

Parameters:

Name Type Description Default
bag_path str

Path to the bag file.

required
output_dir str

Output directory.

required
fmt str

Output format ("parquet" or "json").

'parquet'
topics list[str] | None

Topics to export (None = all).

None
flatten bool

Flatten nested message fields.

True
ai_mode bool

Enable AI-friendly transformations (normalized timestamps, etc.).

False

Returns:

Type Description
dict[str, Path]

Dict mapping topic names to output file paths.

Raises:

Type Description
ValueError

If fmt is not 'parquet' or 'json'.

print_export_summary(output_files, console=None)

Print export results.