10 unstable releases (3 breaking)

0.4.0 Apr 3, 2024
0.3.1 Mar 4, 2024
0.2.3 Feb 21, 2024
0.2.2 Mar 29, 2023
0.1.2 Jul 4, 2022

#461 in Filesystem

Download history 133/week @ 2024-07-28 23/week @ 2024-08-04 1/week @ 2024-08-11 20/week @ 2024-08-18 60/week @ 2024-08-25 44/week @ 2024-09-01 11/week @ 2024-09-08 9/week @ 2024-09-15 14/week @ 2024-09-22 12/week @ 2024-09-29 48/week @ 2024-10-06 65/week @ 2024-10-13 26/week @ 2024-10-20 134/week @ 2024-10-27 292/week @ 2024-11-03

522 downloads per month

MIT/Apache

14KB
275 lines

csv-zip-maker-rs

CSV and ZIP maker

Documentation

Features

  • CSV and Zip file make in temp dir.
  • Cleanup files at drop.
  • Use file instead of memory.

Changes

CHANGELOG.md

Examples

use csv_zip_maker::{customize::CsvExcelUtf16Customizer, CsvExcelCustomizer, CsvZipError, CsvZipMaker};

fn main() -> Result<(), CsvZipError> {
    let mut maker = CsvZipMaker::new("test", "summary")?;
    let mut csv_maker = maker.make_csv_maker_for_excel("summary1")?;
    csv_maker.write(&vec!["aaa", "bbb"])?;
    csv_maker.write(&vec!["ccc", "ddd"])?;
    maker.add_csv(&mut csv_maker)?;
    let mut csv_maker = maker.make_csv_maker("summary2")?;
    csv_maker.write(&vec!["111", "222"])?;
    csv_maker.write(&vec!["333", "444"])?;
    maker.add_csv(&mut csv_maker)?;

    // UTF16
    let mut csv_maker = maker.make_csv_maker_with_customizer("summary3", CsvExcelUtf16Customizer)?;
    csv_maker.write(&vec!["予定表~①\n💖ハンカクだ", "予定表~②💖ハンカクだ"])?;
    csv_maker.write(&vec!["予定表~③💖ハンカクだ", "予定表~④💖ハンカクだ"])?;
    
    maker.add_csv_utf16(&mut csv_maker)?;

    let path_buf = maker.make_zip_file()?;
    std::fs::copy(path_buf, "test.zip")?;
    Ok(())
}

Dependencies

~5–14MB
~177K SLoC