File: models.py

package info (click to toggle)
py-nextbusnext 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 148 kB
  • sloc: python: 752; makefile: 50
file content (119 lines) | stat: -rw-r--r-- 2,043 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
from typing import TypedDict


class AgencyInfo(TypedDict):
    id: str
    name: str
    shortName: str
    region: str
    website: str
    logo: str
    nxbs2RedirectUrl: str


class PredictionRouteInfo(TypedDict):
    id: str
    title: str
    description: str
    color: str
    textColor: str
    hidden: bool


class RouteInfo(PredictionRouteInfo):
    rev: int
    timestamp: str


class RouteBoundingBox(TypedDict):
    latMin: float
    latMax: float
    lonMin: float
    lonMax: float


class StopInfo(TypedDict):
    id: str
    lat: float
    lon: float
    name: str
    code: str
    hidden: bool
    showDestinationSelector: bool
    directions: list[str]


class PredictionStopInfo(TypedDict):
    id: str
    lat: float
    lon: float
    name: str
    code: str
    hidden: bool
    showDestinationSelector: bool
    route: str


class Point(TypedDict):
    lat: float
    lon: float


class RoutePath(TypedDict):
    id: str
    points: list[Point]


class DirectionInfo(TypedDict):
    id: str
    shortName: str
    name: str
    useForUi: bool
    stops: list[str]


class RouteDetails(TypedDict):
    id: str
    rev: int
    title: str
    description: str
    color: str
    textColor: str
    hidden: bool
    boundingBox: RouteBoundingBox
    stops: list[StopInfo]
    directions: list[DirectionInfo]
    paths: list[RoutePath]
    timestamp: str


class PredictionDirection(TypedDict):
    id: str
    name: str
    destinationName: str


class PredictionValue(TypedDict):
    timestamp: int
    minutes: int
    affectedByLayover: bool
    isDeparture: bool
    occupancyStatus: int
    occupancyDescription: str
    vehiclesInConsist: int
    linkedVehicleIds: str
    vehicleId: str
    vehicleType: str | None
    direction: PredictionDirection
    tripId: str
    delay: int
    predUsingNavigationTm: bool
    departure: bool


class StopPrediction(TypedDict):
    serverTimestamp: int
    nxbs2RedirectUrl: str
    route: PredictionRouteInfo
    stop: PredictionStopInfo
    values: list[PredictionValue]