Last active
March 8, 2020 18:53
-
-
Save jadudm/c1e4f42ff3b1abb58f1875e13a646cf1 to your computer and use it in GitHub Desktop.
tbl 20200308 01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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