Thanks to visit codestin.com
Credit goes to lib.rs

2 releases

Uses new Rust 2024

0.2.1 Apr 21, 2026
0.2.0 Apr 21, 2026

#1618 in Text processing


Used in univert-gui

AGPL-3.0-or-later

54KB
1.5K SLoC

Univert

The universal file converter — a single CLI that converts between 27 file formats, preferring pure-Rust libraries and shelling out only for tools with no Rust equivalent (LilyPond, OpenSCAD, FFmpeg, FluidSynth).

For the desktop version, see univert-gui.

Install

cargo install univert

Usage

univert <input-file> <output-file> [OPTIONS]

Flags:

  • -f, --force — overwrite existing output
  • -l, --list — print every supported conversion and exit
  • -s, --split — split source file into several target files (csv/tsv → json)
  • -h, --help, -V, --version

Examples:

univert notes.json notes.yaml
univert contacts.vcf contacts.json
univert logo.svg logo.png
univert song.abc song.midi          # requires lilypond + abc2ly
univert part.scad part.stl          # requires openscad
univert track.wav track.aac         # requires ffmpeg

Supported conversions

Pure-Rust (no external tool required):

From To
json, yaml, json5 each other (round-trip)
csv, tsv html, json, json5, yaml, and each other
vcf json, json5, yaml
html md
bmp, gif, ico, jpeg, png, tga, tif each other
psd, jp2 bmp, gif, ico, jpeg, png, tga, tif
svg png, pdf
stl obj

Shell-out to external tools when available:

From To Required binary
abc, ly midi, pdf, png, ps, svg lilypond, abc2ly
scad csg, off, png, stl openscad
wav aac, mp3 ffmpeg
midi wav fluidsynth + a SoundFont

Run univert --list for the complete registry.

Library

use std::path::Path;

let opts = univert::Options { force: true, split: false };
univert::convert(Path::new("in.csv"), Path::new("out.json"), &opts)?;
# Ok::<(), univert::Error>(())

License

AGPL-3.0-or-later

Dependencies

~28–38MB
~716K SLoC