Created
May 16, 2014 15:24
-
-
Save gpiffault/afbe2352bab7b67cce73 to your computer and use it in GitHub Desktop.
Reader for zipped csv files (like GTFS)
This file contains hidden or 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
class GTFSFile(object): | |
def __init__(self, file_path): | |
self.archive = zipfile.ZipFile(file_path) | |
def get_table(self, table_name): | |
return csv.DictReader(io.TextIOWrapper(self.archive.open(table_name), "utf-8")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment