Skip to content

v0.15.0

Latest

Choose a tag to compare

@narugo1992 narugo1992 released this 28 Oct 02:17

Random access to zip archives

hfutils.index reads the members of a zip archive without downloading it, in a Hugging Face repository (hf_zip_*) or on disk (zip_*), and hfutils ils lists zips. The zip's own central directory is the index: nothing to build or keep fresh, only the bytes that are asked for travel (Range requests).

  • split archives (7-Zip X.zip.001, Info-ZIP X.z01 + X.zip) open from any volume; ZIP64, data in front of the archive and Info-ZIP pipe archives are handled
  • the format is decided by content, never by extension; what is not a zip raises NotAZipError that says what it looks like (tar, gzip, git-lfs-pointer, html, ...)
  • stored, deflate, deflate64, bzip2, lzma, xz, zstd, shrink, reduce, implode; ZipCrypto and WinZip AES with remembered passwords; PPMd, strong encryption and encrypted directories are reported as unsupported
  • pip install hfutils[zip] adds the optional packages (cryptography, inflate64, zstandard)
  • hfutils ils reads zips (--format, --encoding) and no longer fails on an archive of one file

Development

  • unit tests measure branch coverage; every line and branch a pull request changes must be covered (codecov patch 100 %)
  • make rst_auto generates the API pages

Pull request: #78