Swiftpack.co - mtgto/SevenZip.swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by mtgto.
mtgto/SevenZip.swift 0.2.0
Swift library to extract 7zip archive using LZMA SDK
⭐️ 3
🕓 3 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/mtgto/SevenZip.swift.git", from: "0.2.0")


A tiny Swift library to extract 7zip archive using LZMA SDK v23.01.


  • ☑ Extract a file from 7z archive file to memory


  • iOS 13+
  • macOS 10.15+

Not supported features

  • Extract encrypted files
  • Extract first file immediately from solid archive
  • Create a 7z archive


import SevenZip

let archive: Archive = try Archive(fileURL: url)
let entry: Entry = archive.entries.first!
let path: String = entry.path
let size : UInt64 = entry.uncompressedSize
let data = try archive.extract(entry: entry)


Swift Package Manager

Add https://github.com/mtgto/SevenZip.swift to your Package.swift.

IMPORTANT NOTE: If you are using this library, you must specify git revision, not by version. See #1 comment for details.

Related projects

  • PLzmaSDK
    • iOS / macOS library which has whole features in LZMA C++ SDK
    • However, it is very slow to extract from large solid file in my environment


Swift parts of this software is released under the MIT License, see LICENSE.txt.

LZMA SDK is placed in the public domain. See https://www.7-zip.org/sdk.html .


Stars: 3
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

3 weeks ago
  • Change unsafeFlags to -mcrc for iOS build (#3)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics