Skip to content

Instantly share code, notes, and snippets.

@yuttie
Created December 20, 2020 04:16
Show Gist options
  • Save yuttie/b1e15afb3e2ea0e125d46e781f5346d4 to your computer and use it in GitHub Desktop.
Save yuttie/b1e15afb3e2ea0e125d46e781f5346d4 to your computer and use it in GitHub Desktop.
import csv
from io import TextIOWrapper
from urllib.request import urlopen
with urlopen('https://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv') as f:
if f.status == 200:
for row in csv.DictReader(TextIOWrapper(f, encoding='cp932', newline='')):
print(row)
else:
raise 'Something was wrong'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment