[Python-ideas] Adding ziplib

Paul Moore p.f.moore at gmail.com
Tue Feb 17 00:37:16 CET 2015


On 16 February 2015 at 23:19, Ethan Furman <ethan at stoneleaf.us> wrote:
>> The idea is to reorganize Python's zip support just like the sha and md5 modules were put into the hashlib module. Name?
>> ziplib.
>
> Seems like an interesting idea.

Agreed. A unified interface would be nice for those applications that
want to be able to work with general "archives". There's quite a lot
of code like that around (shutil has some, distutils' sdists can be
zip or tgz files, ...)

>> Thoughts?
>
> Have you checked to see if anybody has already done this in the wild?

That's certainly worth doing. Also, this may be something that would
work better on PyPI - a stdlib module would certainly be a
possibility, but there's so much code out there using the zipfile
module (maybe not so much using tarfile, I'm not sure) that a ziplib
module is unlikely ever to be a *replacement*, just an addition with a
unified interface. Backward compatibility would prevent anything else.
And as a wrapper round stdlib classes, it may find a good home on PyPI
for people that need it.

But your ABC-based approach (which presumably would allow extension to
add in new archive types like 7-zip) seems like a good design.

(Hmm, it seems like I'm saying "put a module on PyPI" a lot at the
moment - that's odd, as I'm normally a strong proponent of the
"batteries included" philosophy. I need to go take my medication...)

Paul


More information about the Python-ideas mailing list