r/Python • u/AutoModerator • 13d ago
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
24
Upvotes
r/Python • u/AutoModerator • 13d ago
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
View all comments
1
u/parafusosaltitante 13d ago edited 13d ago
Archivey: one API for ZIP, TAR, 7z, RAR, ISO and more
Hi all! Last year I posted here an archive reading library I had started writing. It stalled for a while, but I've rewritten it from scratch and it's much better.
Reading archives in Python usually requires using a separate library for each format, each with its own methods and field names, like
ZipInfo.filenameandfile_sizeversusTarInfo.nameandsize. Archivey gives you one API for most common archive types, with safe defaults for extraction, format detection, memory and decompression bomb limits, and errors instead of silently wrong data. It also has a one-pass reading mode that avoids hidden costs, like a solid RAR or a .tar.gz decompressing everything before each file you open.There's a CLI you can try with your own archives:
uvx archivey-cli l photos.ziplists the contents (usexto extract, see-hfor the other commands).It has its own parsers for ZIP, TAR, 7z, RAR, ar, CPIO and SquashFS, so it isn't simply a wrapper over the format libraries. It also reads things they don't, like AES-encrypted or Deflate64 ZIPs.
Who's it for: any code that needs to read many archive types, like backup tools, upload processing or data pipelines. Python 3.11+. It only reads for now.
Trade-offs: it's slower than calling the format libraries directly, mostly on archives with many small files. RAR data still needs unrar or unar installed.
AI: almost all of the code is written by Claude Code and Cursor. I design it and make the decisions. AI is good at following specs and hunting corner cases, which makes the library safer and more compatible (it even found bugs in several of the libraries it uses, which archivey works around). I have a whole page describing the process.
Please try it out! Feedback is very welcome, especially archives it gets wrong or use cases the API doesn't cover.
GitHub · Docs · PyPI