-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroute_info.py
50 lines (43 loc) · 1019 Bytes
/
route_info.py
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
from dataclasses import dataclass, field
from enum import IntEnum, auto
import pandas as pd
from datetime import datetime
@dataclass
class Data:
feed_data: list = field(default_factory=list)
trips: pd.DataFrame = field(default_factory=pd.DataFrame)
stop_times: pd.DataFrame = field(default_factory=pd.DataFrame)
stops: pd.DataFrame = field(default_factory=pd.DataFrame)
class Stop(IntEnum):
alg = 1
ela = auto()
ipa = auto()
mcr = auto()
dkn = auto()
swn = auto()
plp = auto()
epc = auto()
sfd = auto()
wsn = auto()
nlr = auto()
mpn = auto()
mck = auto()
ggn = auto()
nan = auto()
class Status(IntEnum):
incoming_at = 0
stopped_at = auto()
in_transit_to = auto()
scheduled = auto()
@dataclass
class Location:
stop: Stop
dest: Stop
trip_id: str
seq: int
status: Status
@dataclass
class Arrival:
Location: Location = None
time: datetime = None
time_min: float = None