koleo-cli 0.2.137.16__py3-none-any.whl → 0.2.137.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of koleo-cli might be problematic. Click here for more details.

koleo/types.py DELETED
@@ -1,237 +0,0 @@
1
- import typing as t
2
-
3
-
4
- class BaseStationInfo(t.TypedDict):
5
- id: int
6
- name: str
7
- name_slug: str
8
-
9
-
10
- # i want to kms
11
- class ExtendedBaseStationInfo(BaseStationInfo):
12
- hits: int
13
- version: str # "A", "B"
14
- is_group: bool
15
- city: str | None
16
- region: str
17
- country: str
18
- latitude: float
19
- longitued: float
20
-
21
-
22
- class ExtendedStationInfo(BaseStationInfo):
23
- ibnr: int
24
- localised_name: str
25
- on_demand: bool
26
-
27
-
28
- class StationBannerClockHandsPositon(t.TypedDict):
29
- x: float
30
- y: float
31
-
32
-
33
- class StationBannerClockHands(t.TypedDict):
34
- url: str | None
35
- position: StationBannerClockHandsPositon
36
-
37
-
38
- class StationBannerClock(t.TypedDict):
39
- visible: bool | None
40
- hands: StationBannerClockHands
41
-
42
-
43
- class StationBanner(t.TypedDict):
44
- url: str
45
- clock: StationBannerClock
46
-
47
-
48
- class Address(t.TypedDict):
49
- full: str
50
- zip: str
51
-
52
-
53
- class Feature(t.TypedDict):
54
- id: str
55
- name: str
56
- available: bool
57
-
58
-
59
- class StationOpeningHours(t.TypedDict):
60
- day: int # 0-6
61
- open: str # 00:00
62
- close: str # 24:00
63
-
64
-
65
- class StationDetails(t.TypedDict):
66
- banner: StationBanner
67
- address: Address
68
- lat: float
69
- lon: float
70
- opening_hours: list[StationOpeningHours]
71
- features: list[Feature]
72
-
73
-
74
- class StationLocalizedToTrain(BaseStationInfo):
75
- train_id: int
76
-
77
-
78
- class ApiBrand(t.TypedDict):
79
- id: int
80
- name: str # EIC, IC, IR, REG, ...
81
- display_name: str
82
- logo_text: str
83
- color: str # hex
84
- carrier_id: int
85
-
86
-
87
- class Carrier(t.TypedDict):
88
- id: int
89
- name: str # Koleje Dolnośląskie, POLREGIO
90
- short_name: str # KD, PR
91
- slug: str
92
- legal_name: str # PKP Szybka Kolej Miejska w Trójmieście Sp.z o.o.
93
-
94
-
95
- class DiscountInfo(t.TypedDict):
96
- id: int
97
- passenger_percentage: int
98
- display_passenger_percentage: float
99
- flyer_second_class_percentage: int
100
- flyer_first_class_percentage: int
101
- express_second_class_percentage: int
102
- express_first_class_percentage: int
103
- dependent_on_ids: list[int]
104
- name: str
105
- rank: int
106
- season_passenger_percentage: int
107
- displayable: bool
108
- is_company: bool
109
-
110
-
111
- class TrainOnStationInfo(t.TypedDict):
112
- arrival: str | None # first station
113
- departure: str | None # last station
114
- stations: list[StationLocalizedToTrain]
115
- train_full_name: str
116
- brand_id: int
117
- platform: str # could be empty; some countries dont use arabic numerals or even tracks
118
- track: str # could be empty; some countries dont use arabic numerals or even tracks
119
-
120
-
121
- class TrainCalendar(t.TypedDict):
122
- id: int
123
- train_nr: int
124
- train_name: str
125
- trainBrand: int
126
- dates: list[str] # Y-M-D
127
- train_ids: list[int]
128
- date_train_map: dict[str, int]
129
-
130
-
131
- class TrainCalendarResponse(t.TypedDict):
132
- train_calendars: list[TrainCalendar]
133
-
134
-
135
- class TimeDict(t.TypedDict):
136
- hour: int
137
- minute: int
138
- second: int
139
-
140
-
141
- TrainAttribute = t.Tuple[int, str, str, str, bool, str]
142
-
143
-
144
- class TrainDetail(t.TypedDict):
145
- id: int
146
- train_nr: int
147
- name: str | None
148
- train_full_name: str
149
- run_desc: str # "09.09-15.09 - w pt - nd; 16.09-29.09, 14.10-03.11 - codziennie; 30.09-06.10 - w pn; 07.10-13.10 - we wt - nd; 04.11-10.11 - w pn - sb"
150
- carrier_id: int
151
- brand_id: int
152
- train_name: int # wtf
153
- duration_offset: int # wtf?
154
- db_train_nr: int # lol
155
-
156
-
157
- class TrainStop(t.TypedDict):
158
- id: int
159
- station_id: int
160
- station_name: str
161
- station_slug: str
162
- train_id: int
163
- arrival: TimeDict
164
- departure: TimeDict
165
- position: int # the stop nr
166
- train_nr: int | None
167
- brand_id: int
168
- distance: int # meters
169
- entry_only: bool
170
- exit_only: bool
171
- station_display_name: str
172
- platform: str
173
- vehicle_type: str | None # ED161
174
-
175
-
176
- class TrainDetailResponse(t.TypedDict):
177
- train: TrainDetail
178
- stops: list[TrainStop]
179
-
180
-
181
- class ConnectionTrainStop(t.TypedDict):
182
- arrival: TimeDict | str # WTF KOLEO!!!!
183
- departure: TimeDict | str # WTF KOLEO!!!!
184
- distance: int
185
- in_path: bool
186
- station_id: int
187
- next_day: bool
188
- position: int
189
- train_nr: int
190
- brand_id: int
191
- entry_only: bool
192
- exit_only: bool
193
- platform: str
194
- track: str
195
- on_demand: bool
196
-
197
-
198
- class ConnectiontrainDetail(TrainDetail):
199
- arrival: TimeDict | str # WTF KOLEO!!!!
200
- departure: TimeDict | str # WTF KOLEO!!!!
201
- stops: list[ConnectionTrainStop]
202
- bookable: bool
203
- train_attribute_ids: list[int]
204
- travel_time: int
205
- direction: str
206
- start_station_id: int
207
- end_station_id: int
208
- fixed_carriage_composition: bool
209
- is_option_groups_available: bool
210
-
211
-
212
- class ErrorDict(t.TypedDict):
213
- type: str
214
- value: str
215
-
216
-
217
- class ConnectionDetail(t.TypedDict):
218
- id: int
219
- distance: int
220
- purchasable: bool
221
- purchasable_errors: list[ErrorDict]
222
- travel_time: int
223
- changes: int
224
- needs_document: bool
225
- brand_ids: list[int]
226
- start_station_id: int
227
- end_station_id: int
228
- arrival: TimeDict | str # WTF KOLEO!!!!
229
- departure: TimeDict | str # WTF KOLEO!!!!
230
- bookable: bool
231
- special_event_slug: str | None
232
- is_advanced_travel_options: bool
233
- is_child_birthday_required: bool
234
- max_passengers_count: bool
235
- constriction_info: list[str]
236
- is_estimated_timetable_available: bool
237
- trains: list[ConnectiontrainDetail]
@@ -1,71 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: koleo-cli
3
- Version: 0.2.137.16
4
- Summary: Koleo CLI
5
- Home-page: https://github.com/lzgirlcat/koleo-cli
6
- Author: Zoey !
7
- Maintainer-email: cb98uzhd@duck.com
8
- License: GNU General Public License v3.0
9
- Project-URL: Source (GitHub), https://github.com/lzgirlcat/koleo-cli
10
- Project-URL: Issue Tracker, https://github.com/lzgirlcat/koleo-cli/issues
11
- Keywords: koleo,timetable,trains,rail,poland
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.12
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: rich~=13.7
18
- Requires-Dist: requests~=2.32
19
-
20
- # Koleo CLI
21
- [![PyPI - Version](https://img.shields.io/pypi/v/koleo-cli.svg)](https://pypi.org/project/koleo-cli)
22
- [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/koleo-cli.svg)](https://pypi.org/project/koleo-cli)
23
-
24
- ## Installation
25
- **install via pip by running** `pip install koleo-cli`
26
-
27
-
28
- ![gif showcasing the functionality](https://github.com/lzgirlcat/koleo-cli/blob/main/koleo-cli.gif?raw=true)
29
-
30
- ## it currently allows you to:
31
- - get departures/arrival list for a station
32
- - get train info given its number and name(pull requests are welcome if you know how to get a train object by just the number)
33
- - find a station or list all known stations
34
- - find a connection from station a to b, with filtering by operators
35
- - save a station as your favourite to quickly check it's departures
36
-
37
- additionally you can also use the KoleoAPI wrapper directly in your own projects, all returns are fully typed using `typing.TypedDict`
38
-
39
- ## MY(possibly controversial) design choices:
40
- - platforms and track numbers are shown using arabic numerals instead of roman
41
- - you can change it by adding `use_roman_numerals: true` to your config.json file
42
- - most api queries are cached for 24h
43
- - you can change it by adding `disable_cache: true` to your config.json file
44
- - the cli.py code is really dirty but printing formatted data is hard :<
45
-
46
- pull requests are welcome!!
47
-
48
- ```
49
- usage: koleo [-h] [-c CONFIG] [--nocolor] {departures,d,dep,odjazdy,o,arrivals,a,arr,przyjazdy,p,trainroute,r,tr,t,poc,pociąg,stations,s,find,f,stacje,ls,connections,do,z,szukaj,path} ...
50
-
51
- Koleo CLI
52
-
53
- options:
54
- -h, --help show this help message and exit
55
- -c CONFIG, --config CONFIG
56
- Custom config path.
57
- --nocolor Disable color output and formatting
58
-
59
- actions:
60
- {departures,d,dep,odjazdy,o,arrivals,a,arr,przyjazdy,p,trainroute,r,tr,t,poc,pociąg,stations,s,find,f,stacje,ls,connections,do,z,szukaj,path}
61
- departures (d, dep, odjazdy, o)
62
- Allows you to list station departures
63
- arrivals (a, arr, przyjazdy, p)
64
- Allows you to list station departures
65
- trainroute (r, tr, t, poc, pociąg)
66
- Allows you to show the train's route
67
- stations (s, find, f, stacje, ls)
68
- Allows you to find stations by their name
69
- connections (do, z, szukaj, path)
70
- Allows you to search for connections from a to b
71
- ```
@@ -1,13 +0,0 @@
1
- koleo/__init__.py,sha256=N_IkOBZCSPCCw31Hu72CFys707PziGFmXpNVl0CXAz8,47
2
- koleo/__main__.py,sha256=wu5N2wk8mvBgyvr2ghmQf4prezAe0_i-p123VVreyYc,62
3
- koleo/api.py,sha256=J05sdOg0S0VgcJNcmmoE8fYMKVVmtqkw5Sy88e-C91k,5713
4
- koleo/cli.py,sha256=7cRfzAGdbkONXb5uk43lt6HH92TR4ruNyNtGa3N9hCw,24738
5
- koleo/storage.py,sha256=L31IrXxdWiGGOraVBdFeHc1Z-a2fNvyRn-uC7gJWe9E,2305
6
- koleo/types.py,sha256=pjVCIH39rUNeipazeRKOuTRCWoslLdbGivKiQmfd5Pw,5226
7
- koleo/utils.py,sha256=AWRmyO2y0ol2t2EjznamZTlxcIxBaTTkxl9Ha0XBv4s,2007
8
- koleo_cli-0.2.137.16.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
- koleo_cli-0.2.137.16.dist-info/METADATA,sha256=y1DauN9svwBMG3cPnaexjps4n1gatNd6RLJDYA1jozM,3092
10
- koleo_cli-0.2.137.16.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
11
- koleo_cli-0.2.137.16.dist-info/entry_points.txt,sha256=LtCidkVDq8Zd7-fxpRbys1Xa9LTHMZwXVbdcQEscdes,41
12
- koleo_cli-0.2.137.16.dist-info/top_level.txt,sha256=AlWdXotkRYzHpFfOBYi6xOXl1H0zq4-tqtZ2XivoWB4,6
13
- koleo_cli-0.2.137.16.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- koleo = koleo.cli:main