Skip to main content

Convert tabular data (CSV, Parquet, Excel, etc.) to MCAP format with support for ROS2 and JSON schemas

Project description

Tabular2MCAP

Documentation Supported by Alloy

Convert tabular data (CSV, Parquet, Excel, and more) to MCAP format with support for ROS2 and JSON schemas, enabling seamless integration with robotics workflows, data visualization in Foxglove Studio, and playback of sensor and navigation data.

Please ⭐ if this helps you today!

🎥 Video Tutorial

Convert CSV, Excel, or Parquet to MCAP in minutes with this step‑by‑step walkthrough.

Converting CSV to MCAP tutorial

Features

  • Multi-Format Support: Convert to ROS2, JSON, or Protobuf messages with support for standard message types (e.g., sensor_msgs/msg/NavSatFix, geometry_msgs/msg/TransformStamped, foxglove.LocationFix, and more)
  • Configuration-Driven: YAML-based mapping with Jinja2 templates for flexible data transformation
  • Batch Processing: Process multiple files and directories with a single command

Quick Start

Installation

# Basic installation (CSV, TSV, JSON, Pickle)
pip install tabular2mcap

# With optional formats
pip install tabular2mcap[parquet]      # Parquet files
pip install tabular2mcap[feather]      # Feather files
pip install tabular2mcap[orc]          # ORC files
pip install tabular2mcap[excel]        # Excel files (.xlsx)
pip install tabular2mcap[excel-legacy] # Excel files (.xls)
pip install tabular2mcap[xml]          # XML files
pip install tabular2mcap[protobuf]     # Protobuf output format
pip install tabular2mcap[all-formats]  # All formats

Basic Usage

tabular2mcap \
  -i /path/to/data/directory \
  -o output.mcap \
  -c config.yaml \
  -f converter_functions.yaml

Configuration System

The tool uses YAML configuration files to define how CSV files should be processed. These are:

  • config.yaml: Defines file patterns and converter function mappings
  • converter_functions.yaml: Contains Jinja2 templates for data transformation

Example Configurations

JSON Format:

# config.yaml
writer_format: "json"
file_mappings:
  - file_pattern: 'data.csv'
    converter_functions:
      - function_name: "row_to_foxglove_location_fix"
        schema_name: "foxglove.LocationFix"
        topic_suffix: "LocationFix"

ROS2 Format:

# config.yaml
writer_format: "ros2"
tabular_mappings:
  - file_pattern: '**/data.csv'
    converter_functions:
      - function_name: "row_to_nav_sat_fix"
        schema_name: "sensor_msgs/msg/NavSatFix"
        topic_suffix: "NavSatFix"

Protobuf Format:

# config.yaml
writer_format: "protobuf"
tabular_mappings:
  - file_pattern: '**/data.csv'
    converter_functions:
      - function_name: "row_to_location_fix"
        schema_name: "foxglove.LocationFix"
        topic_suffix: "LocationFix"

Note: Protobuf repeated fields are variable length (no fixed-size arrays like ROS2). Array templates show a single placeholder element; populate with actual data dynamically.

Tutorial

For detailed instructions on adding support for new types of CSV data, see the Tutorial in the documentation.

Supported By

Alloy

This project is supported by Alloy - Search all your robot data in plain english. Alloy provides a platform to unify image, time-series, and log search for robotics teams.

License

GNU General Public License v3.0 - see LICENSE for details.

Contributing

See CONTRIBUTING.md for development setup, testing, and contribution guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabular2mcap-0.1.9.tar.gz (88.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabular2mcap-0.1.9-py3-none-any.whl (116.4 kB view details)

Uploaded Python 3

File details

Details for the file tabular2mcap-0.1.9.tar.gz.

File metadata

  • Download URL: tabular2mcap-0.1.9.tar.gz
  • Upload date:
  • Size: 88.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tabular2mcap-0.1.9.tar.gz
Algorithm Hash digest
SHA256 9d0e84ec3d1f1b41ffb30e42aab0da27859d79fb4e9744f675297d340e3f59b4
MD5 c5ef3c72feccc8d23ae3340168d16062
BLAKE2b-256 9e26264b2f1241c8c9bb136cb871349dc9c9e88d6e34da19517089d9698a7597

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabular2mcap-0.1.9.tar.gz:

Publisher: publish.yml on alloyrobotics/tabular2mcap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tabular2mcap-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: tabular2mcap-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 116.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tabular2mcap-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 413d5b199d98b925093a38b5eb5f072b1c21737cc7ec8ae0941059e18ac39cea
MD5 e64e340bca65c929d3876d5bbdad0711
BLAKE2b-256 9a8f58073ab71f8e801bb7ddb088dff1d9782a863cfef3b65da795eda2c6ebee

See more details on using hashes here.

Provenance

The following attestation bundles were made for tabular2mcap-0.1.9-py3-none-any.whl:

Publisher: publish.yml on alloyrobotics/tabular2mcap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page