| Crates.io | csvmd |
| lib.rs | csvmd |
| version | 0.3.0 |
| created_at | 2025-06-17 12:55:27.839563+00 |
| updated_at | 2025-09-04 08:46:37.941512+00 |
| description | Convert from CSV to a Markdown table |
| homepage | https://github.com/timrogers/csvmd |
| repository | https://github.com/timrogers/csvmd |
| max_upload_size | |
| id | 1715713 |
| size | 87,484 |
Convert a CSV file to a Markdown table 📊
# Convert a file on disk
csvmd input.csv > output.md
# Convert a file passed to stdin
cat input.csv | csvmd > output.md
brew tap timrogers/tap && brew install csvmd.csvmd --help to check that everything is working and see the available commands.csvmd crate by running cargo install csvmd.csvmd --help to check that everything is working and see the available commands.$PATH, so you can execute it from your shell. For the best experience, call it csvmd on macOS and Linux, and csvmd.exe on Windows.csvmd --help to check that everything is working and see the available commands.Convert CSV to Markdown table
Usage: csvmd [OPTIONS] [FILE]
Arguments:
[FILE] Input CSV file (if not provided, reads from stdin)
Options:
-d, --delimiter <DELIMITER> CSV delimiter character [default: ,]
--no-headers Treat first row as data, not headers
--stream Use streaming mode for large files (writes output immediately)
--align <ALIGN> Header alignment: left, center, or right [default: left]
-h, --help Print help
-V, --version Print version
# Basic usage with left-aligned headers (default)
csvmd data.csv
# Center-aligned headers for better readability
csvmd --align center data.csv
# Right-aligned headers for numeric data
csvmd --align right financial_data.csv
# Combined with other options
csvmd --delimiter ";" --align center --no-headers data.csv
# Streaming mode with alignment for large files
csvmd --stream --align center large_dataset.csv
csvmd is built for speed and efficiency. Here are some benchmarks showing processing times for various scenarios:
| Dataset | Rows | Input Size | Standard Mode | Streaming Mode (File) | Streaming Mode (Stdin) |
|---|---|---|---|---|---|
| Employee Records | 1,000 | 57KB | 4ms / 3MB | 4ms / 2.6MB | 4ms / 2.6MB |
| Employee Records | 10,000 | 576KB | 10ms / 6.2MB | 10ms / 2.7MB | 10ms / 2.7MB |
| Employee Records | 100,000 | 5.8MB | 90ms / 42MB | 130ms / 2.6MB | 140ms / 17MB |
| Employee Records | 200,000 | 12MB | 180ms / 80MB | 270ms / 2.7MB | 280ms / 35MB |
Key Benefits of Streaming Mode:
csvmd handles complex CSV data efficiently, including:
|) that need escaping| Dataset | Rows | Input Size | Standard Mode | Streaming Mode |
|---|---|---|---|---|
| Complex Data | 1,000 | 124KB | 4ms / 3MB | 4ms / 2.6MB |
| Complex Data | 10,000 | 1.3MB | 10ms / 8.3MB | 10ms / 2.6MB |
The --stream flag provides significant memory efficiency improvements, especially for large files. The implementation uses two different strategies based on input source:
| Mode | Memory Usage | Reduction |
|---|---|---|
| Standard | 42MB | - |
| Streaming (Stdin) | 17MB | 60% less |
| Streaming (File) | 2.6MB | 94% less |
Examples:
# File input: optimal memory efficiency
csvmd --stream data.csv > output.md
# Piped input: still provides memory savings
cat data.csv | csvmd --stream > output.md
# With custom alignment
csvmd --stream --align center data.csv > output.md