Use the requests
library to download each sheet, and write the response content to a file.
Working implementation:
import requests
sheets = {
'sheet1': 'https://docs.google.com/spreadsheets/d/14hFn00O9632n96Z2xGWvfrcY-K4kHiOGR02Rx7dsj54/export?format=csv&id=14hFn00O9632n96Z2xGWvfrcY-K4kHiOGR02Rx7dsj54&gid=0',
'sheet2': 'https://docs.google.com/spreadsheets/d/14hFn00O9632n96Z2xGWvfrcY-K4kHiOGR02Rx7dsj54/export?format=csv&id=14hFn00O9632n96Z2xGWvfrcY-K4kHiOGR02Rx7dsj54&gid=447738801'
}
for sheet in list(sheets.keys()):
response = requests.get(sheets[sheet])
with open(f'{sheet}.csv', 'wb') as csvfile:
csvfile.write(response.content)
This will save each sheet in a file (sheet1.csv
and sheet2.csv
in this case). Note that I got the link for each sheet just by downloading it as CSV from a browser and copying the download link.
You can then convert it to a dictionary using the CSV library. See this post.