#zip-archive #zip #extract #archive

zip-extract

Archive extraction via zip-rs, automated

4 releases

0.1.3 Jan 22, 2024
0.1.2 Feb 26, 2023
0.1.1 Jan 26, 2022
0.1.0 Jun 22, 2020

#38 in Compression

Download history 2061/week @ 2024-01-22 2215/week @ 2024-01-29 2554/week @ 2024-02-05 3024/week @ 2024-02-12 2871/week @ 2024-02-19 3262/week @ 2024-02-26 3080/week @ 2024-03-04 2343/week @ 2024-03-11 4860/week @ 2024-03-18 4866/week @ 2024-03-25 4838/week @ 2024-04-01 4026/week @ 2024-04-08 2837/week @ 2024-04-15 2803/week @ 2024-04-22 2733/week @ 2024-04-29 3575/week @ 2024-05-06

12,338 downloads per month
Used in 37 crates (26 directly)

MIT license

170KB
114 lines

zip-extract

CI Crates.io Docs.rs

zip-extract's primary goal is simple: Automate tedious zip extraction. Ever wanted to just unpack an archive somewhere? Well, here you go.

Usage

let archive: Vec<u8> = download_my_archive()?;
let target_dir = PathBuf::from("my_target_dir"); // Doesn't need to exist

// The third parameter allows you to strip away toplevel directories.
// If `archive` contained a single directory, its contents would be extracted instead.
zip_extract::extract(Cursor::new(archive), &target_dir, true)?;

Features

All features are the same as the features of the zip crate:

  • aes-crypto: Support for AES encryption via the the zip crate
  • deflate: Support for the Deflate algorithm (miniz_oxide rust-backend)
  • deflate-miniz: ^ dito (miniz C-backend)
  • deflate-zlib: ^ dito (zlib C-backend)
  • unreserved: Support for the unreserved feature of the zip crate
  • bzip2: Support for .bzip2 archives via the bzip2 crate
  • time: Support for the time crate for the zip crate
  • zstd: Support for the zstd crate for the zip crate
  • default: enables "aes-crypto", "bzip2", "deflate", "zstd"

Dependencies

~6.5MB
~109K SLoC