-
Notifications
You must be signed in to change notification settings - Fork 17
Add departure card mapping #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
b916780
d07caab
e55d00f
d9436fe
0986bc9
f9f59f5
c90ca36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| from typing import TypedDict, NotRequired | ||
| from enum import Enum | ||
| from enum import Enum, IntEnum | ||
|
|
||
|
|
||
| class LocationSearchType(Enum): | ||
|
|
@@ -12,6 +12,56 @@ class LocationSearchType(Enum): | |
| ADDRESS_OR_POI = "AP" # Search for addresses and POIs | ||
|
|
||
|
|
||
| class BoardLanguage(Enum): | ||
| SV = "sv" # Swedish | ||
| EN = "en" # English | ||
| DA = "da" # Danish | ||
| NO = "no" # Norwegian | ||
| DE = "de" # German | ||
| FR = "fr" # French | ||
| IT = "it" # Italian | ||
| NL = "nl" # Dutch | ||
| TR = "tr" # Turkish | ||
| PL = "pl" # Polish | ||
| ES = "es" # Spanish | ||
| HU = "hu" # Hungarian | ||
|
|
||
|
|
||
| class LocationType(Enum): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
| ST = "ST" # Stop or station | ||
| ADR = "ADR" # Address | ||
| POI = "POI" # Point of interest | ||
| CRD = "CRD" # Coordinate | ||
| MCP = "MCP" # Mode change point | ||
| HL = "HL" # Hailing point | ||
|
|
||
|
|
||
| class TransportCategory(Enum): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
| BLT = "BLT" # Regional bus (lanstrafik), e.g. SL, UL, Skanetrafiken | ||
| BXB = "BXB" # Express bus | ||
| BAX = "BAX" # Airport express bus | ||
| BRE = "BRE" # Regional bus other than lanstrafik | ||
| BBL = "BBL" # Train replacement bus | ||
| ULT = "ULT" # Metro | ||
| JAX = "JAX" # Airport express train | ||
| JEX = "JEX" # Express train | ||
| JIC = "JIC" # InterCity train | ||
| JLT = "JLT" # Local train | ||
| JPT = "JPT" # PagaTag | ||
| JST = "JST" # High-speed train | ||
| JRE = "JRE" # Regional train | ||
| SLT = "SLT" # Tram | ||
| FLT = "FLT" # Local ferry | ||
| FUT = "FUT" # International ferry | ||
|
|
||
|
|
||
| class JourneyStatus(Enum): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
| PLANNED = "P" # Planned | ||
| REPLACEMENT = "R" # Replacement | ||
| ADDITIONAL = "A" # Additional | ||
| SPECIAL = "S" # Special | ||
|
|
||
|
|
||
| class StopLookupEntry(TypedDict): | ||
| id: str | ||
| extId: NotRequired[str] | ||
|
|
@@ -28,3 +78,95 @@ class StopLocationWrapper(TypedDict): | |
|
|
||
| class StopLookupResponse(TypedDict): | ||
| stopLocationOrCoordLocation: list[StopLocationWrapper] | ||
|
|
||
|
|
||
| class JourneyDetailRef(TypedDict): | ||
| ref: str | ||
|
|
||
|
|
||
| class Stop(TypedDict): | ||
| name: str | ||
| id: str | ||
| extId: str | ||
| lon: float | ||
| lat: float | ||
| routeIdx: int | ||
| arrTime: NotRequired[str] | ||
| arrDate: NotRequired[str] | ||
| depTime: NotRequired[str] | ||
| depDate: NotRequired[str] | ||
|
|
||
|
|
||
| class Product(TypedDict): | ||
| name: str | ||
| cls: str | ||
| internalName: NotRequired[str] | ||
| num: NotRequired[str] | ||
| displayNumber: NotRequired[str] | ||
| line: NotRequired[str] | ||
| lineId: NotRequired[str] | ||
| catCode: NotRequired[str] | ||
| catOut: NotRequired[TransportCategory] | ||
| catIn: NotRequired[TransportCategory] | ||
| catOutS: NotRequired[TransportCategory] | ||
| catOutL: NotRequired[str] | ||
| operatorCode: NotRequired[str] | ||
| operator: NotRequired[str] | ||
|
|
||
|
|
||
| class DepartureStops(TypedDict): | ||
| stop: list[Stop] | ||
|
|
||
|
|
||
| class DepartureBoardEntry(TypedDict): | ||
| Stops: DepartureStops | ||
| ProductAtStop: Product | ||
| Product: list[Product] | ||
| name: str | ||
| type: LocationType | ||
| stop: str | ||
| stopid: str | ||
| stopExtId: str | ||
| time: str # Scheduled departure/arrival time, formatted as HH:MM:SS | ||
| date: str # Scheduled departure/arrival date, formatted as YYYY-MM-DD | ||
| rtTime: NotRequired[str] # Realtime departure/arrival time, formatted as HH:MM:SS | ||
| rtDate: NotRequired[str] # Realtime departure/arrival date, formatted as YYYY-MM-DD | ||
| direction: str | ||
| transportNumber: str | ||
| transportCategory: TransportCategory | ||
| reachable: NotRequired[bool] | ||
| JourneyStatus: NotRequired[JourneyStatus] | ||
| JourneyDetailRef: NotRequired[JourneyDetailRef] | ||
|
|
||
|
|
||
| class ArrivalBoardEntry(TypedDict): | ||
| Stops: list[Stop] | ||
| ProductAtStop: Product | ||
| Product: list[Product] | ||
| name: str | ||
| type: LocationType | ||
| stop: str | ||
| stopid: str | ||
| stopExtId: str | ||
| time: str | ||
| date: str | ||
| direction: str | ||
| transportNumber: str | ||
| transportCategory: TransportCategory | ||
| JourneyStatus: NotRequired[JourneyStatus] | ||
| JourneyDetailRef: NotRequired[JourneyDetailRef] | ||
|
|
||
|
|
||
| class ListOfDepartures(TypedDict): | ||
| Departure: list[DepartureBoardEntry] | ||
| requestId: NotRequired[str] | ||
|
|
||
|
|
||
| class ListOfArrivals(TypedDict): | ||
| Arrival: list[ArrivalBoardEntry] | ||
| requestId: NotRequired[str] | ||
|
|
||
|
|
||
| class ResrobotException(TypedDict): | ||
| errorCode: str | ||
| errorText: str | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
StrEnum