I downloaded a google-spreadsheet as an object in python.
How can I use openpyxl use the workbook without having it to save to disk first?
I know that xlrd c
I was looking to load a file from an URL and here is what I came up with:
util:
from openpyxl import load_workbook
from io import BytesIO
import urllib
def load_workbook_from_url(url):
file = urllib.request.urlopen(url).read()
return load_workbook(filename = BytesIO(file))
usage:
import openpyxl_extended
book = openpyxl_extended.load_workbook_from_url('https://storage.googleapis.com/pnbx-cdn/pen-campaign/campaigner-template-fr.xlsx')