Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtgto/sevenzip.swift
Swift library to extract 7zip archive using LZMA SDK
https://github.com/mtgto/sevenzip.swift
7zip swift
Last synced: 2 months ago
JSON representation
Swift library to extract 7zip archive using LZMA SDK
- Host: GitHub
- URL: https://github.com/mtgto/sevenzip.swift
- Owner: mtgto
- License: mit
- Created: 2021-10-17T15:06:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-18T09:06:36.000Z (8 months ago)
- Last Synced: 2024-05-18T10:22:01.896Z (8 months ago)
- Topics: 7zip, swift
- Language: C
- Homepage:
- Size: 723 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SevenZip.swift
A tiny Swift library to extract 7zip archive using [LZMA SDK v24.05](https://www.7-zip.org/sdk.html).
## Feature
- [x] Extract a file from 7z archive file to memory
## Requirements
- iOS 13+
- macOS 10.15+## Not supported features
- Extract encrypted files
- Extract first file immediately from solid archive
- Create a 7z archive## Usage
```swift
import SevenZiplet 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)
```## Installation
### 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](https://github.com/mtgto/SevenZip.swift/issues/1#issuecomment-1690084540) for details.
## Related projects
- [PLzmaSDK](https://github.com/OlehKulykov/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## License
Swift parts of this software is released under the MIT License, see [LICENSE.txt](LICENSE.txt).
LZMA SDK is placed in the public domain. See https://www.7-zip.org/sdk.html .