.day_of_week

GtfsServicesReaderSettings method
Description

The .day_of_week property allows the user to either access or set the filter for which day of the week the GTFS dataset is to be parsed for. If not set, all services across the entire dataset will be parsed. However, in most situations this is not desirable because the underlying network will be used to model specific reference day(s). By setting the .day_of_week property the user decides which day of the week is chosen and only those GTFS routes that run on that day will be parsed

Currently, only a single day can be chosen

Currently, special event days in the GTFS calendar are ignored, only regular services are considered.

Signature

services_settings.day_of_week = DayOfWeek.<a day> , or

day_of_week: DayOfWeek = services_settings.day_of_week

Return type

DayOfWeek

Example 1

from planit import *

# create an intermodal converter
planit_instance = Planit()
intermodal_converter = planit_instance.converter_factory.create(ConverterType.INTERMODAL)

from planit import *

# create an intermodal converter
planit_instance = Planit()
intermodal_converter = planit_instance.converter_factory.create(ConverterType.INTERMODAL)

# <some_intermodal_reader> = construct OSM or PLANit intermodal reader for example 

# GTFS reader
gtfs_reader: GtfsIntermodalReaderWrapper = \
    intermodal_converter.create_reader(IntermodalReaderType.GTFS, "Australia", <some_intermodal_reader>)

## Filter to Thursday GTFS services ##
gtfs_reader.settings.services_settings.day_of_week = DayOfWeek.THURSDAY
assert gtfs_reader.settings.services_settings.day_of_week == DayOfWeek.THURSDAY

See also

N/A

Source code

Class GtfsServicesReaderSettingsWrapper in converterwrappers.py