I want to manipulate a downloaded PDF using PyPDF and for that, I need a file object.
I use GAE to host my Python app, so I cannot actually write the file to disk.
Is there any way to obtain the file object from URL or from a variable that contains the file contents?
TIA.
Most tools (including
urllib) already give you a file-like, but if you need true random access then you’ll need to create aStringIO.StringIOand read the data into it.