4 releases (2 breaking)

Uses new Rust 2021

new 0.6.0 May 17, 2022
0.5.0 Feb 1, 2022
0.4.1 Nov 10, 2021
0.4.0 Nov 2, 2021

#23 in #cldr

Download history 17/week @ 2022-01-28 3/week @ 2022-02-04 3/week @ 2022-02-11 3/week @ 2022-02-18 1/week @ 2022-02-25 6/week @ 2022-03-11 15/week @ 2022-03-18 3/week @ 2022-04-08 4/week @ 2022-04-22 18/week @ 2022-04-29 16/week @ 2022-05-06 71/week @ 2022-05-13

109 downloads per month
Used in icu_testdata

Custom license

4.5MB
40K SLoC

icu_datagen crates.io

icu_datagen is a library to generate data files that can be used in ICU4X data providers.

Data files can be generated either programmatically (i.e. in build.rs), or through a command-line utility.

Examples

build.rs

use icu_datagen::*;
use icu_locid::langid;
use std::fs::File;
use std::path::PathBuf;

fn main() {
    icu_datagen::datagen(
        Some(&[langid!("de"), langid!("en-AU")]),
        &icu_datagen::keys(&["list/and@1"]),
        &SourceData::default().with_uprops(PathBuf::from("/path/to/uprops/root")),
        Out::Blob(Box::new(File::create("data.postcard").unwrap())),
        false,
    ).unwrap();
}

Command line

The command line interface is available with the bin feature.

cargo run --features bin -- \
    --uprops-root /path/to/uprops/root \
    --all-keys \
    --locales de,en-AU \
    --format blob \
    --out data.postcard

More details can be found by running --help.

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

Dependencies

~10–20MB
~379K SLoC