calendar

gtfs.calendar

Cleaners & utilities specific to the calendar table.

Functions

Name Description
create_calendar_from_dates Use the calendar_dates table to populate a calendar table.

create_calendar_from_dates

gtfs.calendar.create_calendar_from_dates(calendar_dates)

Use the calendar_dates table to populate a calendar table.

Use this in cases where a gtfs feed has elected to use a calendar-dates table and no calendar. Only adds values for calendar_dates entries tagged as exception_type 1. Exception_type 2 is not treated. Those entries are ignored whilst making the calendar table.

Parameters

Name Type Description Default
calendar_dates pd.DataFrame The calendar_dates table. required

Returns

Type Description
pd.DataFrame A calendar table based on values in the calendar_dates table.

Raises

Type Description
TypeError calendar_dates is not a pd.DataFrame
IndexError calendar_dates does not contain any of the following columns - service_id, date, exception_type.