I need to verify if an widget which basically is a .zip are according to this compliance rules:
http://www.w3.org/TR/widgets/#zip-archive
So what I need is to be able to check in that archive:
- Compression Methods;
- Version of Zip Needed to Extract a File Entry;
- Zip Relative Paths (path lengths, character encoding, filenames)
What would be the way to approach this from python(what lib to use, some minimal code example would help)?
you should use the
zipfilelib – try this http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/zipfile/index.html:To test if the file is a zip file:
And to access the info of a zip file: