mcdp-format2-rs

Crates.iomcdp-format2-rs
lib.rsmcdp-format2-rs
version2.17.2
created_at2025-07-14 16:12:27.544314+00
updated_at2025-07-14 16:16:26.621547+00
descriptionA Rust library for loading and saving datasets in the MCDP V2 format.
homepage
repository
max_upload_size
id1751998
size282,007
Andrea Censi (AndreaCensi)

documentation

README

mcdp-format2-rs

A Rust library for loading and saving datasets in the MCDP V2 format.

Overview

mcdp-format2-rs is a Rust implementation for parsing and handling MCDP format version 2 files. It supports multiple serialization formats including JSON, YAML, and CBOR, with optional gzip compression.

Features

  • Multiple Format Support: JSON, YAML, CBOR with optional gzip compression
  • Pattern-based File Discovery: Find MCDP files using glob patterns
  • Command-line Interface: Built-in CLI tool for parsing and validation
  • Comprehensive Type System: Strongly-typed data structures for MCDP components
  • Error Handling: Robust error handling with detailed context

Installation

Add this to your Cargo.toml:

[dependencies]
mcdp-format2-rs = "2"

Usage

Library Usage

use mcdp_format2_rs::{read_mcdp_root, Root};
use std::path::Path;

// Load an MCDP file
let path = Path::new("example.mcdp2.json");
let root: Root = read_mcdp_root(path)?;

Command-line Usage

The package includes a CLI tool mcdp-format2-rs-load for parsing and validating MCDP files:

# Parse all MCDP files in a directory
mcdp-format2-rs-load /path/to/mcdp/files

# Use a custom pattern
mcdp-format2-rs-load -p "*.mcdp2.json" /path/to/files

# Verbose output
mcdp-format2-rs-load -v /path/to/files

Supported File Formats

The library automatically detects file format based on extension:

  • .json - JSON format
  • .yaml, .yml - YAML format
  • .cbor - CBOR format
  • .json.gz - Gzipped JSON
  • .yaml.gz, .yml.gz - Gzipped YAML
  • .cbor.gz - Gzipped CBOR
Commit count: 0

cargo fmt