Category "python-zipfile"

How to process a string as a file to contruct a ZipFile object?

I am currently pulling data from a database with blobs. I retrieve the blob from the database, but I need to parse the text. the ZipFile class takes in files no

Using Databricks/Python3.x ZipFile to extract 7gb file from zip

I've got a large NPI zipfile which includes a 7.3gb csv. (file can be located on NPI site here: http://download.cms.gov/nppes/NPI_Files.html -- the Full Replac

How to compress folders using zipfile?

My program so far is successfully able to add and compress files which are present in the same directory as test.py but there is also a folder named location in

OSError Invalid argument when extracting with Python zipfile on Linux

I want to extract a file within a .zip archive to another directory. First I create a ZipFile object zfile = '/home/.../filename.zip' archive = zipfile.Zi

zipfile write dont find files in gcloud

Im trying zip a few files from Google Storage. The zipfile of Python doesnt find the files in gcloud, just in the project. How can I do for my code find the f

Python: How to efficiently open and read a zipfile from multiple processes

I'm trying to open the same .zip file from multiple processes using zipfile and multiprocessing. When I open the .zip file using the with zipfile.ZipFile(self.

How to avoid zipfile error with python-pptx saving files

I am using the python-pptx package to create a number of .pptx files from a series of dataframes. All works well with adding slides and such until it comes time

ZipFile script that zips all desired file contents

So I'm dealing with a script that needs to zip all files into a single folder that share the same name. So, for example, the folder structure looks like this...

Parsing in memory CSV files from zip archives

I'm working on a new library which will allow the user to parse any file (xlsx, csv, json, tar, zip, txt) into generators. Now I'm stuck at zip archive and when

Setting unix permissions in a ZipFile in a portable python script

I'm trying to create a python script which places a number of files in a "staging" directory tree, and then uses ZipFile to a create a .zip archive of them. Thi

Get top level directory within the zipfile

I have the following structure within a zipped file "test.zip" JOU=00335/VOL=2019.30/ISU=9-10/ART=9812/data.xml JOU=00335/VOL=2019.30/ISU=9-10/ART=9813/data.xm

How to fix 'Input/output error' while extracting zipfile?

I am working with a 150GB+ zipfile of dicom images. I am trying to extract some of these by their filenames. I am working on google collab python 3 interpreter

Reversing the encoding of a zipfile

After decoding this string from base64 I found my string to be malformed? I'm not really sure about the string and how to convert it to a readable format. I've

Create a zip with only .pdf and .xml files from one directory

I would love to know how i can zip only all pdfs from the main directory without including the subfolders. I've tried several times changing the code, without a

zipfile module in python to compress files

Can zipfile module be used to compress files to a 7z archive? I have to work with a set of csv files and I have been asked to 7zip these files. I wanted to know

Why does Python zipfile not give the same output .zip file size as command-line zip?

Here is the size of the file generated by zip: $ seq 10000 > 1.txt $ zip 1 1.txt adding: 1.txt (deflated 54%) $ ls -og 1.zip -rw-r--r-- 1 22762 Aug 29 10

Errno 22 Invalid argument - Zipfile Is Skipped

I am working on a project in Python in which I am parsing data from a zipped folder containing log files. The code works fine for most zips, but occasionally th

Python zipfile: file name with new line characters

Somebody managed somehow to add a new line character \r\n to the name of a file in a zip, and that makes ZipFile fail when it tries to extract the zip: 2019-07

Check if file is actually a zipfile

I know I can use testzip or just try to uncompress the file and catch the exception. My issue is that I might have .msg files which have attachments that are z

ZipFile get creation date

I would like to get the creation date of a file inside zipped folder. I know that without zip, this can be achieved with using os.path.getctime() function and