33 releases

new 0.2.19 May 8, 2026
0.2.18 Mar 23, 2026
0.2.14 Dec 11, 2025
0.2.10 Nov 26, 2025
0.1.10 Oct 5, 2023

#157 in Text processing

Download history 291/week @ 2026-01-17 320/week @ 2026-01-24 382/week @ 2026-01-31 429/week @ 2026-02-07 430/week @ 2026-02-14 416/week @ 2026-02-21 784/week @ 2026-02-28 694/week @ 2026-03-07 884/week @ 2026-03-14 658/week @ 2026-03-21 730/week @ 2026-03-28 1012/week @ 2026-04-04 863/week @ 2026-04-11 442/week @ 2026-04-18 423/week @ 2026-04-25 999/week @ 2026-05-02

3,046 downloads per month
Used in 13 crates (11 directly)

Apache-2.0

320KB
7.5K SLoC

Debian Changelog parser

This crate provides a parser for debian/changelog files, as described in the Debian policy, section 4.4.

The parser builds a CST. It is lossless - i.e. preserves formatting, and allows editing and partial parsing.

Example:


use std::io::Read;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let file = std::fs::File::open("/usr/share/doc/rustc/changelog.Debian.gz")?;
    let mut gz = flate2::read::GzDecoder::new(file);
    let mut contents = String::new();
    gz.read_to_string(&mut contents)?;
    let changelog: debian_changelog::ChangeLog = contents.parse()?;
    for entry in changelog.entries() {
        println!(
            "{}: {}",
            entry.package().unwrap(),
            entry.version().unwrap().to_string()
        );
    }
    Ok(())
}

Or to update an existing changelog file:


use std::io::Read;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let file = std::fs::File::open("debian/changelog")?;
    let mut contents = String::new();
    file.read_to_string(&mut contents)?;
    let mut changelog: debian_changelog::ChangeLog = contents.parse()?;
    changelog.try_auto_add_change(
        &["* Make a change"],
        (
            "Jelmer Vernooij".to_string(),
            "jelmer@debian.org".to_string(),
        ),
        None,
        None,
    )?;
    std::fs::write("debian/changelog", changelog.to_string())?;
    Ok(())
}

Dependencies

~6–8MB
~133K SLoC