Contents:
Bases: builtins.object
A class to gather all the GTFS files for a feed and store them in memory as Pandas data frames. Make sure you have enough memory! The stop times object can be big.
Create a Pandas data frame representing agency.txt and save it to self.agency.
Create all Pandas data frames necessary for a GTFS feed.
Create a Pandas data frame representing calendar.txt and save it to self.calendar. Create the service IDs from the distinct weekly activities of the service windows. Also save the dictionary service window ID -> service ID to self.service_by_window.
Create a Pandas data frame representing routes.txt and save it to self.routes.
Create a Pandas data frame representing shapes.txt and save it to self.shapes. Shape IDs in frequencies.csv that are not in shapes.geojson will be ignored.
Create a Pandas data frame representing stop_times.txt and save it to self.stop_times.
Will create self.stops, self.trips, self.shapes if they don’t already exist.
Create a Pandas data frame representing stops.txt and save it to self.stops. Create one stop at the beginning (the first point) of each shape and one at the end (the last point) of each shape.
Will not create stops for shape IDs listed in frequencies.csv but not present in shapes.geojson
Create a Pandas data frame representing trips.txt and save it to self.trips. Trip IDs encode route, direction, and service window information to make it easy to compute stop times later.
Will create self.calendar, self.routes, and self.shapes if they don’t already exist.
Will not create trips for routes with null linestrings.
Assuming all the necessary data frames have been created (as in create_all()), export them to CSV files to the given output directory. If as_zip is True, then instead write the files to a zip archive called gtfs.zip in the given output directory. If output_dir is None, then write to self.input_dir.
Return a dictionary of the form shape ID -> Shapely linestring of shape. Shape IDs in frequencies.csv that are not in shapes.geojson will not appear in the dictionary. If use_utm == True, then return each linestring in in UTM coordinates. Otherwise, return each linestring in WGS84 longitude-latitude coordinates.
Return the duration of the time period between the first and second time string in the given units. Allowable units are ‘s’ (seconds), ‘min’ (minutes), ‘h’ (hours). Assume timestr1 < timestr2.
Get command line arguments, create feed, and export feed.
Parse command line options and return an object with two attributes: input_dir, a list of one input directory path, and output_file, a list of one output file path.
Given a time string of the form ‘%H:%M:%S’, return the number of seconds past midnight that it represents. In keeping with GTFS standards, the hours entry may be greater than 23. If mod24 == True, then return the number of seconds modulo 24*3600. If inverse == True, then do the inverse operation. In this case, if mod24 == True also, then first take the number of seconds modulo 24*3600.