| Crates.io | chordlib |
| lib.rs | chordlib |
| version | 0.5.0 |
| created_at | 2025-11-26 11:02:52.749823+00 |
| updated_at | 2025-11-26 11:03:40.032159+00 |
| description | Work with chord-and-lyrics songs: parse, transform, and render them to multiple formats |
| homepage | https://github.com/xilefmusics/chordlib |
| repository | https://github.com/xilefmusics/chordlib |
| max_upload_size | |
| id | 1951247 |
| size | 196,805 |
Rust helpers to parse, transform, and render chord-and-lyrics songs. The crate understands common formats (ChordPro, Ultimate Guitar tabs) and can render to HTML, ChordPro, or a terminal-friendly view.
cargo add chordlib
To install the CLI, enable the bin feature (and optionally download/html):
cargo install chordlib --features "bin download html"
use chordlib::inputs::chord_pro;
use chordlib::outputs::FormatRender;
fn main() -> Result<(), chordlib::Error> {
let song = chord_pro::load_string(r#"
{title: Example Song}
{artist: An Artist}
[C]Line one with [G]chords
[F]Line two keeps the [C]beat
"#)?;
// Render a terminal-friendly output.
println!("{}", song.format_render(None, None, None));
Ok(())
}
Render an Ultimate Guitar tab to HTML:
chordlib https://tabs.ultimate-guitar.com/tab/artist/song-123456 \
--render \
--output song.html
The CLI supports transposition (--key), Nashville notation (--nashville), vowel-based chord shifting (--vowel-move), and output formats including ChordPro (.cp/.wp), HTML, and JSON.
bin: build the chordlib CLI.download: fetch Ultimate Guitar tabs over HTTP.html: parse HTML tabs and render HTML output.