-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The API should allow any generated schedule to be exported in a .csv format to make it easier to import into Google Sheets.
GET /schedule/{id}.csv?format={format}
The API should respond with a text/csv file including the information on the schedule. Format can be one of two options: default and sheets-export. If the query option is not specified, default to default.
Default format
Return a 10x5 (r x c) cell file where each column is one day (Monday to Friday) and each pair of rows is one hour slot (two subjects are shifted in the same slot).
a1,a1,a1,a1,a1
a2,a2,a2,a2,a2
b1,b1,b1,b1,b1
b2,b2,b2,b2,b2
c1,c1,c1,c1,c1
c2,c2,c2,c2,c2
d1,d1,d1,d1,d1
d2,d2,d2,d2,d2
e1,e1,e1,e1,e1
e2,e2,e2,e2,e2
Sheets export format
When pasting into sheets, it is useful to have a format that conforms to the layout of the Google Sheet used to post schedules. In this format, the csv should be 20x5 and includes each pair of rows duplicated. This is because the Google Sheet uses 30 minute intervals instead of the scheduler's default of hour-long intervals.
a1,a1,a1,a1,a1
a2,a2,a2,a2,a2
a1,a1,a1,a1,a1
a2,a2,a2,a2,a2
b1,b1,b1,b1,b1
b2,b2,b2,b2,b2
b1,b1,b1,b1,b1
b2,b2,b2,b2,b2
c1,c1,c1,c1,c1
c2,c2,c2,c2,c2
c1,c1,c1,c1,c1
c2,c2,c2,c2,c2
d1,d1,d1,d1,d1
d2,d2,d2,d2,d2
d1,d1,d1,d1,d1
d2,d2,d2,d2,d2
e1,e1,e1,e1,e1
e2,e2,e2,e2,e2
e1,e1,e1,e1,e1
e2,e2,e2,e2,e2