A thin Swift wrapper around a vendored minizip (including AES) linked against system zlib:
create an archive from a set of paths, or extract one, both with optional password support.
Zip, ZipStatus, and ProcessedFilePath are Sendable; the target builds under Swift 6
language mode. No async/await yet — synchronous, blocking file I/O.
No external SwiftPM dependencies — everything needed is built in-tree.
Integration status: standalone library — nothing else in this ecosystem depends on it yet. Not deprecated, just not yet wired into a consumer.
The pre-Swift-6 version is preserved on the legacy branch.
Add this project as a dependency in your Package.swift file, then add "PerfectZip" to your target's dependencies.
.package(url: "https://github.com/PerfectlySoft/Perfect-Zip.git", branch: "main")The following will zip the specified directory:
import PerfectZip
let zippy = Zip()
let thisZipFile = "/path/to/ZipFile.zip"
let sourceDir = "/path/to/files/"
let ZipResult = zippy.zipFiles(
paths: [sourceDir],
zipFilePath: thisZipFile,
overwrite: true, password: ""
)
print("ZipResult Result: \(ZipResult.description)")To unzip a file:
import PerfectZip
let zippy = Zip()
let sourceDir = "/path/to/files/"
let thisZipFile = "/path/to/ZipFile.zip"
let UnZipResult = zippy.unzipFile(
source: thisZipFile,
destination: sourceDir,
overwrite: true
)
print("Unzip Result: \(UnZipResult.description)")For more information on the Perfect project, please visit perfect.org.