streamly-zip: Stream data from zip archives using the streamly library.

[ archive, bsd3, codec, library, streaming, streamly ] [ Propose Tags ] [ Report a vulnerability ]

Please see the README on GitHub at https://github.com/shlok/streamly-zip#readme


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1
Change log ChangeLog.md
Dependencies base (>=4.14 && <5), bytestring (>=0.10 && <0.12), containers (>=0.6 && <0.7), streamly (>=0.10.0 && <0.11), streamly-core (>=0.2.0 && <0.3) [details]
License BSD-3-Clause
Copyright 2024 Shlok Datye
Author Shlok Datye
Maintainer sd-haskell@quant.is
Category Archive, Codec, Streaming, Streamly
Home page https://github.com/shlok/streamly-zip
Bug tracker https://github.com/shlok/streamly-zip/issues
Source repo head: git clone https://github.com/shlok/streamly-zip
Uploaded by shlok at 2024-08-13T23:07:32Z
Distributions NixOS:0.0.1
Downloads 28 total (3 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for streamly-zip-0.0.1

[back to package description]

streamly-zip

Stream data from zip archives using the Haskell streamly library.

Comparison with streamly-archive

This library was created because libarchive (which streamly-archive relies on) does not seem to have support for jumping to specific files even when the format supports it.

Requirements

Install libzip on your system.

  • Debian Linux: sudo apt-get install libzip-dev.
  • macOS: brew install libzip.

Quick start

module Main where

import qualified Data.ByteString as B
import Data.Function
import qualified Streamly.Data.Fold as F
import qualified Streamly.Data.Stream.Prelude as S
import Streamly.External.Zip

main :: IO ()
main = do
  -- Obtain an archive.
  z <- openZip "/path/to/archive.zip" []

  -- Output a particular file to stdout.
  S.unfold unfoldFileAtPath (z, [], "file.txt")
    & S.mapM B.putStr
    & S.fold F.drain