talira

SharpCompress

Pure C# library to read and write zip, tar, 7z, rar, gzip, bzip2, xz, zstd and more archives

open sourceMITfree

SharpCompress is a compression library written in pure C# for .NET Framework 4.8, .NET Standard 2.0 and 2.1, and .NET 6, 8 and 10. It reads RAR, 7z, zip, tar, bzip2, gzip, lzip, xz, Zstandard, ARC, ARJ, ACE and LZW, and writes zip, tar, bzip2, gzip, lzip, Zstandard streams and 7z archives. Its main feature is forward-only reading of non-seekable streams, so large archives can be processed as they download, alongside random-access archive APIs; every I/O operation has an async version, and the codecs can be swapped through compression providers.

Problems it solves

  • extract a RAR or 7z file in a .NET app without shelling out to 7-Zip
  • unpack a large tar.gz as it downloads in C# without saving it to disk first
  • create zip and tar.gz archives from C# code

Features

  • unrar, un7zip, unzip, untar and decompress gzip, bzip2, xz, zstd, lzip
  • writes zip, tar, gzip, bzip2, lzip, Zstandard and 7z
  • forward-only reading of non-seekable streams, such as downloads
  • async APIs and swappable compression providers