def read(filename=None):
    if filename is not None:
        zipfile = read_zipfile(filename)
    else:
        zipfile = get_zipfile(URL)
    updated = get_datetime_for_zip(zipfile, 'brewers.csv')
    contents = zipfile.open('brewers.csv')
    return parse_csv_file(contents, get_line_parser(FIELDS)), updated
예제 #2
0
def read():
    r = requests.get(URL)
    r.encoding = 'ISO-8859-1'
    lines = r.text.splitlines()
    parser = get_line_parser(FIELDS)
    return parse_lines(lines, parser), get_datetime(lines)