https://github.com/whtsky/archi
Multi-format archive library based on libarchive
https://github.com/whtsky/archi
libarchive
Last synced: about 2 months ago
JSON representation
Multi-format archive library based on libarchive
- Host: GitHub
- URL: https://github.com/whtsky/archi
- Owner: whtsky
- License: mit
- Created: 2019-11-21T15:38:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-11T11:56:49.000Z (3 months ago)
- Last Synced: 2025-03-24T03:56:11.066Z (about 2 months ago)
- Topics: libarchive
- Language: Cython
- Size: 85.9 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Archi
[](https://whtsky.visualstudio.com/archi/_build/latest?definitionId=2&branchName=master)
Multi-format archive library based on [libarchive](https://github.com/libarchive/libarchive) . Forked from [pyarchive](https://github.com/tailhook/pyarchive)
## Usage
```python
import archiwith open("test.tgz", "rb") as f:
archive = archi.Archive(f)
for file in archive:
print(file.filename)
print(file.read())
```Keep in mind that you **can't** store `Entry`s, they're freed as soon as the loop moves on to the next or ends. So this won't do:
```python
archi = archi.Archive('file.zip')
files = [f for f in archi]
files[0].filename # Address boundary error !
```## Changelog
### vnext
- (wheels) Upgrade bundled libarchive to [v3.6.1](https://github.com/libarchive/libarchive/releases/tag/v3.6.1)
- Fix SIGSEGV when received ARCHIVE_FATAL error### v0.2.3
- (wheels) Upgrade bundled libarchive to [v3.4.3](https://github.com/libarchive/libarchive/releases/tag/v3.4.3)
### v0.2.2
- (wheels) Upgrade bundled libarchive to [v3.4.2](https://github.com/libarchive/libarchive/releases/tag/v3.4.2)
- (wheels) Build macOS wheels on macOS 10.14 (https://github.com/whtsky/archi/pull/6)### v0.2.1
- (wheels) Upgrade bundled libarchive to [v3.4.1](https://github.com/libarchive/libarchive/releases/tag/v3.4.1)
### v0.2.0
- Add support for libarchive's `ARCHIVE_FAILED` error
- use PyMem_Malloc & PyMem_Free instead of alloca### v0.1.1
- Fix binary wheels for macOS
## TODO
- [ ] compression
- [ ] build wheels for Windows: https://discuss.python.org/t/need-auditwheel-like-utility-for-other-platforms/2028 , https://discuss.python.org/t/packaging-dlls-on-windows/1401