Add Circle line fare to Transfer column and Total
Add tfl_fare.py with circle_line_fare() which returns £3.10 (peak) or £3.00 (off-peak) based on TfL Zone 1 pricing. Peak applies Monday–Friday (excluding England public holidays) 06:30–09:30 and 16:00–19:00. Annotate each circle service with its fare in trip_planner.py, display it alongside the Circle line times in the Transfer column, and include it in the journey Total. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
89a536dfd3
commit
35097fda4f
4 changed files with 43 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ Combine GWR station→Paddington trains with Eurostar St Pancras→destination t
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
import circle_line
|
||||
from tfl_fare import circle_line_fare
|
||||
|
||||
MIN_CONNECTION_MINUTES = 50
|
||||
MAX_CONNECTION_MINUTES = 110
|
||||
|
|
@ -31,7 +32,11 @@ def _circle_line_services(arrive_paddington: datetime) -> list[dict]:
|
|||
)
|
||||
services = circle_line.upcoming_services(earliest_board, count=2)
|
||||
return [
|
||||
{"depart": dep.strftime(TIME_FMT), "arrive_kx": arr.strftime(TIME_FMT)}
|
||||
{
|
||||
"depart": dep.strftime(TIME_FMT),
|
||||
"arrive_kx": arr.strftime(TIME_FMT),
|
||||
"fare": circle_line_fare(dep),
|
||||
}
|
||||
for dep, arr in services
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue