Skip to content

Instantly share code, notes, and snippets.

@jadudm
Last active March 8, 2020 18:53
Show Gist options
  • Save jadudm/c1e4f42ff3b1abb58f1875e13a646cf1 to your computer and use it in GitHub Desktop.
Save jadudm/c1e4f42ff3b1abb58f1875e13a646cf1 to your computer and use it in GitHub Desktop.
tbl 20200308 01
from tbl import *
pets_url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSK2rd47ogfI2CpQi2L6HDo9AOEhnhqBN4zR4kLPUO28vBzmlc8XQWrvTfBYCU0ePf478yxcNKdOy5m/pub?gid=0&single=true&output=csv"
pets_tbl = tbl_from_sheet(pets_url)
import csv
import requests
def tbl_from_sheet(csv_url):
with requests.Session() as s:
download = s.get(csv_url)
content = download.content.decode('utf-8')
reader = csv.reader(content.splitlines(), delimiter=',')
for row in list(reader):
print (row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment