https://github.com/ybirader/pzip Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} ybirader / pzip Public * Notifications * Fork 0 * Star 6 A blazing fast concurrent zip archiver and extractor. License Apache-2.0 license 6 stars 0 forks Activity Star Notifications * Code * Issues 5 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights ybirader/pzip This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 5 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/y] Use Git or checkout with SVN using the web URL. [gh repo clone ybirad] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @ybirader ybirader update release config ... 6b7e91b Sep 24, 2023 update release config 6b7e91b Git stats * 140 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows update release config September 24, 2023 18:10 adapters/cli add passing extraction acceptance test September 21, 2023 22:25 cmd refactor: rename dirpath to outputdir September 24, 2023 16:02 internal/testutils handle no args provided September 23, 2023 22:31 pool add generic worker pool September 23, 2023 00:01 specifications add passing extraction acceptance test September 21, 2023 22:25 testdata creates directory with single file September 21, 2023 15:50 .gitignore chore: add goreleaser file September 12, 2023 13:43 .goreleaser.yaml update release config September 24, 2023 18:10 LICENSE chore: change license to apache September 12, 2023 16:55 Makefile add release and docs for punzip September 24, 2023 11:23 README.md update readme September 24, 2023 12:42 archiver.go add release and docs for punzip September 24, 2023 11:23 archiver_options.go add extractor options September 23, 2023 22:24 archiver_test.go remove unused benchmark September 9, 2023 19:55 cli.go refactor: rename dirpath to outputdir September 24, 2023 16:02 cli_test.go add interrupt context and concurrency option September 23, 2023 23:05 extra.go doc: add inline docs September 11, 2023 20:43 extractor.go propagate file modes September 24, 2023 18:00 extractor_options.go add extractor options September 23, 2023 22:24 extractor_test.go add error handling September 23, 2023 00:06 go.mod constrain max buffer size September 5, 2023 21:46 go.sum add error handling to worker pool September 5, 2023 09:58 View code [ ] pzip Features Installation Command Line macOS Debian, Ubuntu, Raspbian Go Build from source Usage Archiving Extraction Benchmarks Contributing License Acknowledgements README.md logo-5 pzip pzip, short for parallel-zip, is a blazing fast concurrent zip archiver and extractor. Features * Archives files and directories into a valid zip archive, using DEFLATE. * Preserves modification times of files. * Files are read and compressed concurrently Installation Command Line For command-line usage, we provide two binaries which can be installed separately: * pzip- concurrent zip archiving * punzip- concurrent zip extraction To install, run: macOS For zip archiving: brew install ybirader/pzip/pzip For zip extraction: brew install ybirader/pzip/punzip Debian, Ubuntu, Raspbian For the latest stable release: curl -1sLf 'https://dl.cloudsmith.io/public/pzip/stable/setup.deb.sh' | sudo -E bash sudo apt update sudo apt install pzip curl -1sLf 'https://dl.cloudsmith.io/public/pzip/stable/setup.deb.sh' | sudo -E bash sudo apt update sudo apt install punzip Go Alternatively, if you have Go installed: go install github.com/ybirader/pzip Build from source To build from source, we require Go 1.21 or newer. 1. Clone the repository by running git clone "https://github.com/ ybirader/pzip.git" 2. Build both pzip and punzip by running make build or build separately via cd cmd/pzip && go build and cd cmd/punzip && go build Usage Archiving pzip's API is similar to that of the standard zip utlity found on most *-nix systems. pzip /path/to/compressed.zip path/to/file_or_directory1 path/to/file_or_directory2 ... path/to/file_or_directoryN Alternatively, pzip can be imported as a package archive, err := os.Create("archive.zip") if err != nil { log.Fatal(err) } archiver, err := pzip.NewArchiver(archive) if err != nil { log.Fatal(err) } defer archiver.Close() files := []string{ "./hello", "./hello.txt", "./bye.md" } err = archiver.Archive(context.Background(), files) if err != nil { log.Fatal(err) } The concurrency of the archiver can be configured using the corresponding flag: pzip --concurrency 2 /path/to/compressed.zip path/to/file_or_directory1 path/to/file_or_directory2 ... path/to/file_or_directoryN or by passing the ArchiverConcurrency option: archiver, err := pzip.NewArchiver(archive, ArchiverConcurrency(2)) Extraction punzip's API is similar to that of the standard unzip utlity found on most *-nix systems. punzip /path/to/compressed.zip By default, punzip extracts into the current directory. We can extract to a particular path by: punzip -d /path/to/output /path/to/compressed.zip Using the Go package, we have: outputDirPath := "./output" archivePath := "./archive.zip" extractor, err := pzip.NewExtractor(outputDirPath) if err != nil { log.Fatal(err) } defer extractor.Close() err = extractor.Extract(context.Background(), archivePath) if err != nil { log.Fatal(err) } As with pzip, we can configure the concurrency of the extractor using: punzip --concurrency 2 /path/to/compressed.zip Similarly, with the Go package, we pass in the ExtractorConcurrency option: extractor, err := pzip.NewExtractor(outputDirPath, ExtractorConcurrency(2)) Benchmarks pzip was benchmarked using Matt Mahoney's sample directory. Using the standard zip utlity, we get the following time to archive: real 14m31.809s user 13m12.833s sys 0m24.193s Running the same benchmark with pzip, we find that: real 0m56.851s user 3m32.619s sys 1m25.040s Contributing To contribute to pzip, first submit or comment in an issue to discuss your contribution, then open a pull request (PR). License pzip is released under the Apache 2.0 license. Acknowledgements Many thanks to the folks at Cloudsmith for graciously providing Debian package hosting. Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence. About A blazing fast concurrent zip archiver and extractor. Resources Readme License Apache-2.0 license Activity Stars 6 stars Watchers 1 watching Forks 0 forks Report repository Releases 3 v0.2.0 Latest Sep 24, 2023 + 2 releases Packages 0 No packages published Languages * Go 99.7% * Makefile 0.3% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.