apyefa 0.0.4__tar.gz → 0.0.5__tar.gz
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 apyefa might be problematic. Click here for more details.
- apyefa-0.0.5/.github/labeler.yml +14 -0
- apyefa-0.0.5/.github/release-drafter.yml +29 -0
- apyefa-0.0.5/.github/workflows/labeler.yml +13 -0
- apyefa-0.0.5/.github/workflows/release_drafter.yml +15 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/PKG-INFO +33 -14
- {apyefa-0.0.4 → apyefa-0.0.5}/README.md +32 -13
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/client.py +10 -12
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/__init__.py +0 -2
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/command_serving_lines.py +5 -3
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/command_stop_finder.py +0 -4
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/data_classes.py +9 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa.egg-info/PKG-INFO +33 -14
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa.egg-info/SOURCES.txt +4 -1
- {apyefa-0.0.4 → apyefa-0.0.5}/pyproject.toml +2 -1
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/test_cmd_departures.py +1 -1
- apyefa-0.0.4/apyefa/commands/command_add_info.py +0 -51
- {apyefa-0.0.4 → apyefa-0.0.5}/.github/workflows/python-package.yml +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/.gitignore +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/.vscode/settings.json +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/LICENSE +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/__init__.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/command.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/command_departures.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/command_system_info.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/command_trip.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/parsers/__init__.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/parsers/parser.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/parsers/rapid_json_parser.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/commands/parsers/xml_parser.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/exceptions.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa/helpers.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa.egg-info/dependency_links.txt +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa.egg-info/requires.txt +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/apyefa.egg-info/top_level.txt +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/examples.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/setup.cfg +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/__init__.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/parsers/__init__.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/parsers/test_json_parser.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/parsers/test_xml_parser.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/test_cmd.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/test_cmd_serving_lines.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/test_cmd_stop_finder.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/test_cmd_system_info.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/commands/test_commands.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/conftest.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/data_classes/__init__.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/data_classes/test_departure.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/data_classes/test_location.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/data_classes/test_system_info.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/data_classes/test_transportation.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/test_client.py +0 -0
- {apyefa-0.0.4 → apyefa-0.0.5}/tests/test_helpers.py +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
documentation:
|
|
2
|
+
- changed-files:
|
|
3
|
+
- any-glob-to-any-file: '**/*.md'
|
|
4
|
+
|
|
5
|
+
# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
|
|
6
|
+
feature:
|
|
7
|
+
- head-branch: ['^feature', 'feature']
|
|
8
|
+
|
|
9
|
+
bugfix:
|
|
10
|
+
- head-branch: ['^bugfix', '^fix']
|
|
11
|
+
|
|
12
|
+
# Add 'release' label to any PR that is opened against the `main` branch
|
|
13
|
+
release:
|
|
14
|
+
- base-branch: 'master'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
categories:
|
|
2
|
+
- title: ":boom: Breaking Changes"
|
|
3
|
+
label: "breaking"
|
|
4
|
+
- title: ":rocket: Features"
|
|
5
|
+
label: "enhancement"
|
|
6
|
+
- title: ":fire: Removals and Deprecations"
|
|
7
|
+
label: "removal"
|
|
8
|
+
- title: ":beetle: Fixes"
|
|
9
|
+
label: "bug"
|
|
10
|
+
- title: ":racehorse: Performance"
|
|
11
|
+
label: "performance"
|
|
12
|
+
- title: ":rotating_light: Testing"
|
|
13
|
+
label: "testing"
|
|
14
|
+
- title: ":construction_worker: Continuous Integration"
|
|
15
|
+
label: "ci"
|
|
16
|
+
- title: ":books: Documentation"
|
|
17
|
+
label: "documentation"
|
|
18
|
+
- title: ":hammer: Refactoring"
|
|
19
|
+
label: "refactoring"
|
|
20
|
+
- title: ":lipstick: Style"
|
|
21
|
+
label: "style"
|
|
22
|
+
- title: ":package: Dependencies"
|
|
23
|
+
labels:
|
|
24
|
+
- "dependencies"
|
|
25
|
+
- "build"
|
|
26
|
+
template: |
|
|
27
|
+
## Changes
|
|
28
|
+
|
|
29
|
+
$CHANGES
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: Draft a release note
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- master
|
|
7
|
+
jobs:
|
|
8
|
+
draft_release:
|
|
9
|
+
name: Release Drafter
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Run release-drafter
|
|
13
|
+
uses: release-drafter/release-drafter@v6.0.0
|
|
14
|
+
env:
|
|
15
|
+
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apyefa
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Python API for EFA(Elektronische Fahrplanauskunft) async requests
|
|
5
5
|
Author-email: Alex Jung <jungdevelop@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -280,14 +280,13 @@ Find lines pass provided location.
|
|
|
280
280
|
|Arguments|Type |Required|Description|
|
|
281
281
|
|---------|--------------------|--------|-----------|
|
|
282
282
|
|location |str \| [Location](#location) |required|The location passed by searched line(s)|
|
|
283
|
+
|req_types|list[[LineRequestType](#lineRequestType)]|optional|The result presentation type(s) can be defined with this argument. Default value is `[]`
|
|
283
284
|
|
|
284
285
|
### Return value
|
|
285
286
|
|Type|Description|
|
|
286
287
|
|----|-----------|
|
|
287
288
|
|list[[Line](#line)]|List of lines found for provided location|
|
|
288
289
|
|
|
289
|
-
> The attribute `origin` of returned `line` objects is None
|
|
290
|
-
|
|
291
290
|
### Examples
|
|
292
291
|
``` python
|
|
293
292
|
async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
|
|
@@ -367,17 +366,37 @@ async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
|
|
|
367
366
|
## TransportType
|
|
368
367
|
```python
|
|
369
368
|
class TransportType(IntEnum):
|
|
370
|
-
|
|
371
|
-
SUBURBAN
|
|
372
|
-
SUBWAY
|
|
373
|
-
CITY_RAIL
|
|
374
|
-
TRAM
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
EXPRESS_BUS
|
|
378
|
-
|
|
379
|
-
FERRY
|
|
380
|
-
AST
|
|
369
|
+
TRAIN = 0 # Zug
|
|
370
|
+
SUBURBAN = 1 # S-Bahn
|
|
371
|
+
SUBWAY = 2 # U-Bahn
|
|
372
|
+
CITY_RAIL = 3 # Stadtbahn
|
|
373
|
+
TRAM = 4 # Straßenbahn
|
|
374
|
+
CITY_BUS = 5 # Stadtbus
|
|
375
|
+
REGIONAL_BUS = 6 # Regionalbus
|
|
376
|
+
EXPRESS_BUS = 7 # Schnellbus
|
|
377
|
+
CABLE_RAIL = 8 # Seilbahn
|
|
378
|
+
FERRY = 9 # Schief
|
|
379
|
+
AST = 10 # Anruf-Sammel-Taxi
|
|
380
|
+
SUSPENSION_RAIL = 11 # Schwebebahn
|
|
381
|
+
AIRPLANE = 12 # Flugzeug
|
|
382
|
+
REGIONAL_TRAIN = 13 # Reginalzug (z.B. IRE, RE und RB)
|
|
383
|
+
NATIONAL_TRAIN = 14 # Nationaler Zug (z.B. IR und D)
|
|
384
|
+
INTERNATINAL_TRAIN = 15 # Internationaler Zug (z.B. IC und EC)
|
|
385
|
+
HIGH_SPEED_TRAIN = 16 # Hochgeschwindigkeitzüge (z.B. ICE)
|
|
386
|
+
RAIL_REPLACEMENT_TRANSPORT = 17 # Schienenersatzverkehr
|
|
387
|
+
SHUTTLE_TRAIN = 18 # Schuttlezug
|
|
388
|
+
CITIZEN_BUS = 19 # Bürgerbus
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
## LineRequestType
|
|
392
|
+
```python
|
|
393
|
+
class LineRequestType(IntEnum):
|
|
394
|
+
NONE = 0
|
|
395
|
+
DEPARTURE_MONITOR = 1
|
|
396
|
+
STOP_TIMETABLE = 2
|
|
397
|
+
TIMETABLE = 4
|
|
398
|
+
ROUTE_MAPS = 8
|
|
399
|
+
STATION_TIMETABLE = 16
|
|
381
400
|
```
|
|
382
401
|
|
|
383
402
|
## CoordFormat
|
|
@@ -235,14 +235,13 @@ Find lines pass provided location.
|
|
|
235
235
|
|Arguments|Type |Required|Description|
|
|
236
236
|
|---------|--------------------|--------|-----------|
|
|
237
237
|
|location |str \| [Location](#location) |required|The location passed by searched line(s)|
|
|
238
|
+
|req_types|list[[LineRequestType](#lineRequestType)]|optional|The result presentation type(s) can be defined with this argument. Default value is `[]`
|
|
238
239
|
|
|
239
240
|
### Return value
|
|
240
241
|
|Type|Description|
|
|
241
242
|
|----|-----------|
|
|
242
243
|
|list[[Line](#line)]|List of lines found for provided location|
|
|
243
244
|
|
|
244
|
-
> The attribute `origin` of returned `line` objects is None
|
|
245
|
-
|
|
246
245
|
### Examples
|
|
247
246
|
``` python
|
|
248
247
|
async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
|
|
@@ -322,17 +321,37 @@ async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
|
|
|
322
321
|
## TransportType
|
|
323
322
|
```python
|
|
324
323
|
class TransportType(IntEnum):
|
|
325
|
-
|
|
326
|
-
SUBURBAN
|
|
327
|
-
SUBWAY
|
|
328
|
-
CITY_RAIL
|
|
329
|
-
TRAM
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
EXPRESS_BUS
|
|
333
|
-
|
|
334
|
-
FERRY
|
|
335
|
-
AST
|
|
324
|
+
TRAIN = 0 # Zug
|
|
325
|
+
SUBURBAN = 1 # S-Bahn
|
|
326
|
+
SUBWAY = 2 # U-Bahn
|
|
327
|
+
CITY_RAIL = 3 # Stadtbahn
|
|
328
|
+
TRAM = 4 # Straßenbahn
|
|
329
|
+
CITY_BUS = 5 # Stadtbus
|
|
330
|
+
REGIONAL_BUS = 6 # Regionalbus
|
|
331
|
+
EXPRESS_BUS = 7 # Schnellbus
|
|
332
|
+
CABLE_RAIL = 8 # Seilbahn
|
|
333
|
+
FERRY = 9 # Schief
|
|
334
|
+
AST = 10 # Anruf-Sammel-Taxi
|
|
335
|
+
SUSPENSION_RAIL = 11 # Schwebebahn
|
|
336
|
+
AIRPLANE = 12 # Flugzeug
|
|
337
|
+
REGIONAL_TRAIN = 13 # Reginalzug (z.B. IRE, RE und RB)
|
|
338
|
+
NATIONAL_TRAIN = 14 # Nationaler Zug (z.B. IR und D)
|
|
339
|
+
INTERNATINAL_TRAIN = 15 # Internationaler Zug (z.B. IC und EC)
|
|
340
|
+
HIGH_SPEED_TRAIN = 16 # Hochgeschwindigkeitzüge (z.B. ICE)
|
|
341
|
+
RAIL_REPLACEMENT_TRANSPORT = 17 # Schienenersatzverkehr
|
|
342
|
+
SHUTTLE_TRAIN = 18 # Schuttlezug
|
|
343
|
+
CITIZEN_BUS = 19 # Bürgerbus
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## LineRequestType
|
|
347
|
+
```python
|
|
348
|
+
class LineRequestType(IntEnum):
|
|
349
|
+
NONE = 0
|
|
350
|
+
DEPARTURE_MONITOR = 1
|
|
351
|
+
STOP_TIMETABLE = 2
|
|
352
|
+
TIMETABLE = 4
|
|
353
|
+
ROUTE_MAPS = 8
|
|
354
|
+
STATION_TIMETABLE = 16
|
|
336
355
|
```
|
|
337
356
|
|
|
338
357
|
## CoordFormat
|
|
@@ -4,7 +4,6 @@ import aiohttp
|
|
|
4
4
|
|
|
5
5
|
from apyefa.commands import (
|
|
6
6
|
Command,
|
|
7
|
-
CommandAdditionalInfo,
|
|
8
7
|
CommandDepartures,
|
|
9
8
|
CommandServingLines,
|
|
10
9
|
CommandStopFinder,
|
|
@@ -14,6 +13,7 @@ from apyefa.data_classes import (
|
|
|
14
13
|
CoordFormat,
|
|
15
14
|
Departure,
|
|
16
15
|
Line,
|
|
16
|
+
LineRequestType,
|
|
17
17
|
Location,
|
|
18
18
|
LocationFilter,
|
|
19
19
|
LocationType,
|
|
@@ -163,20 +163,24 @@ class EfaClient:
|
|
|
163
163
|
|
|
164
164
|
return command.parse(response)
|
|
165
165
|
|
|
166
|
-
async def lines_by_location(
|
|
166
|
+
async def lines_by_location(
|
|
167
|
+
self, location: str | Location, req_types: list[LineRequestType] = []
|
|
168
|
+
) -> list[Line]:
|
|
167
169
|
"""Search for lines that pass `location`. Location can be location ID like `de:08111:6221` or a `Location` object
|
|
168
170
|
|
|
169
171
|
Args:
|
|
170
172
|
location (str | Location): Location
|
|
173
|
+
req_types (list[LineRequestType], optional): List of types for the request. Defaults to empty.
|
|
171
174
|
|
|
172
175
|
Raises:
|
|
173
|
-
ValueError:
|
|
176
|
+
ValueError: Wrong location type provided e.g. LocationType.POI or LocationType.ADDRESS
|
|
174
177
|
|
|
175
178
|
Returns:
|
|
176
179
|
list[Transport]: List of lines
|
|
177
180
|
"""
|
|
178
181
|
_LOGGER.info("Request lines by location")
|
|
179
182
|
_LOGGER.debug(f"location:{location}")
|
|
183
|
+
_LOGGER.debug(f"filters :{req_types}")
|
|
180
184
|
|
|
181
185
|
if isinstance(location, Location):
|
|
182
186
|
if location.loc_type != LocationType.STOP:
|
|
@@ -187,6 +191,9 @@ class EfaClient:
|
|
|
187
191
|
|
|
188
192
|
command = CommandServingLines("odv", location)
|
|
189
193
|
|
|
194
|
+
if req_types:
|
|
195
|
+
command.add_param("lineReqType", sum(req_types))
|
|
196
|
+
|
|
190
197
|
response = await self._run_query(self._build_url(command))
|
|
191
198
|
|
|
192
199
|
return command.parse(response)
|
|
@@ -194,15 +201,6 @@ class EfaClient:
|
|
|
194
201
|
async def locations_by_line(self, line: str | Line) -> list[Location]:
|
|
195
202
|
raise NotImplementedError
|
|
196
203
|
|
|
197
|
-
async def additional_info(self):
|
|
198
|
-
_LOGGER.info("Request additional info")
|
|
199
|
-
|
|
200
|
-
command = CommandAdditionalInfo()
|
|
201
|
-
|
|
202
|
-
response = await self._run_query(self._build_url(command))
|
|
203
|
-
|
|
204
|
-
return command.parse(response)
|
|
205
|
-
|
|
206
204
|
async def _run_query(self, query: str) -> str:
|
|
207
205
|
_LOGGER.info(f"Run query {query}")
|
|
208
206
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from .command import Command
|
|
2
|
-
from .command_add_info import CommandAdditionalInfo
|
|
3
2
|
from .command_departures import CommandDepartures
|
|
4
3
|
from .command_serving_lines import CommandServingLines
|
|
5
4
|
from .command_stop_finder import CommandStopFinder
|
|
@@ -9,7 +8,6 @@ from .command_trip import CommandTrip
|
|
|
9
8
|
__all__ = [
|
|
10
9
|
"Command",
|
|
11
10
|
"CommandDepartures",
|
|
12
|
-
"CommandAdditionalInfo",
|
|
13
11
|
"CommandStopFinder",
|
|
14
12
|
"CommandSystemInfo",
|
|
15
13
|
"CommandTrip",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from voluptuous import Any, Optional, Required, Schema
|
|
3
|
+
from voluptuous import Any, Optional, Range, Required, Schema
|
|
4
4
|
|
|
5
5
|
from apyefa.commands.command import Command
|
|
6
|
-
from apyefa.data_classes import Line
|
|
6
|
+
from apyefa.data_classes import Line, LineRequestType
|
|
7
7
|
|
|
8
8
|
_LOGGER = logging.getLogger(__name__)
|
|
9
9
|
|
|
@@ -48,7 +48,9 @@ class CommandServingLines(Command):
|
|
|
48
48
|
Optional("name_sl"): str,
|
|
49
49
|
# mode 'line'
|
|
50
50
|
Optional("lineName"): str,
|
|
51
|
-
Optional("lineReqType"):
|
|
51
|
+
Optional("lineReqType"): Range(
|
|
52
|
+
min=0, max=sum([x.value for x in LineRequestType])
|
|
53
|
+
),
|
|
52
54
|
Optional("mergeDir"): Any("0", "1", 0, 1),
|
|
53
55
|
Optional("lsShowTrainsExplicit"): Any("0", "1", 0, 1),
|
|
54
56
|
Optional("line"): str,
|
|
@@ -41,10 +41,6 @@ class CommandStopFinder(Command):
|
|
|
41
41
|
Optional("anyResSort_sf"): str,
|
|
42
42
|
Optional("anyObjFilter_sf"): int,
|
|
43
43
|
Optional("doNotSearchForStops_sf"): Any("0", "1", 0, 1),
|
|
44
|
-
Optional("locationInfoActive_sf"): Any("0", "1", 0, 1),
|
|
45
|
-
Optional("useHouseNumberList_sf"): Any("0", "1", 0, 1),
|
|
46
|
-
Optional("useLocalityMainStop"): Any("0", "1", 0, 1),
|
|
47
|
-
Optional("prMinQu"): int,
|
|
48
44
|
Optional("anyObjFilter_origin"): Range(
|
|
49
45
|
min=0, max=sum([x.value for x in LocationFilter])
|
|
50
46
|
),
|
|
@@ -76,6 +76,15 @@ class LocationFilter(IntEnum):
|
|
|
76
76
|
POST_CODES = 64
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
class LineRequestType(IntEnum):
|
|
80
|
+
NONE = 0
|
|
81
|
+
DEPARTURE_MONITOR = 1
|
|
82
|
+
STOP_TIMETABLE = 2
|
|
83
|
+
TIMETABLE = 4
|
|
84
|
+
ROUTE_MAPS = 8
|
|
85
|
+
STATION_TIMETABLE = 16
|
|
86
|
+
|
|
87
|
+
|
|
79
88
|
class CoordFormat(StrEnum):
|
|
80
89
|
WGS84 = "WGS84[dd.ddddd]"
|
|
81
90
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apyefa
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Python API for EFA(Elektronische Fahrplanauskunft) async requests
|
|
5
5
|
Author-email: Alex Jung <jungdevelop@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -280,14 +280,13 @@ Find lines pass provided location.
|
|
|
280
280
|
|Arguments|Type |Required|Description|
|
|
281
281
|
|---------|--------------------|--------|-----------|
|
|
282
282
|
|location |str \| [Location](#location) |required|The location passed by searched line(s)|
|
|
283
|
+
|req_types|list[[LineRequestType](#lineRequestType)]|optional|The result presentation type(s) can be defined with this argument. Default value is `[]`
|
|
283
284
|
|
|
284
285
|
### Return value
|
|
285
286
|
|Type|Description|
|
|
286
287
|
|----|-----------|
|
|
287
288
|
|list[[Line](#line)]|List of lines found for provided location|
|
|
288
289
|
|
|
289
|
-
> The attribute `origin` of returned `line` objects is None
|
|
290
|
-
|
|
291
290
|
### Examples
|
|
292
291
|
``` python
|
|
293
292
|
async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
|
|
@@ -367,17 +366,37 @@ async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
|
|
|
367
366
|
## TransportType
|
|
368
367
|
```python
|
|
369
368
|
class TransportType(IntEnum):
|
|
370
|
-
|
|
371
|
-
SUBURBAN
|
|
372
|
-
SUBWAY
|
|
373
|
-
CITY_RAIL
|
|
374
|
-
TRAM
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
EXPRESS_BUS
|
|
378
|
-
|
|
379
|
-
FERRY
|
|
380
|
-
AST
|
|
369
|
+
TRAIN = 0 # Zug
|
|
370
|
+
SUBURBAN = 1 # S-Bahn
|
|
371
|
+
SUBWAY = 2 # U-Bahn
|
|
372
|
+
CITY_RAIL = 3 # Stadtbahn
|
|
373
|
+
TRAM = 4 # Straßenbahn
|
|
374
|
+
CITY_BUS = 5 # Stadtbus
|
|
375
|
+
REGIONAL_BUS = 6 # Regionalbus
|
|
376
|
+
EXPRESS_BUS = 7 # Schnellbus
|
|
377
|
+
CABLE_RAIL = 8 # Seilbahn
|
|
378
|
+
FERRY = 9 # Schief
|
|
379
|
+
AST = 10 # Anruf-Sammel-Taxi
|
|
380
|
+
SUSPENSION_RAIL = 11 # Schwebebahn
|
|
381
|
+
AIRPLANE = 12 # Flugzeug
|
|
382
|
+
REGIONAL_TRAIN = 13 # Reginalzug (z.B. IRE, RE und RB)
|
|
383
|
+
NATIONAL_TRAIN = 14 # Nationaler Zug (z.B. IR und D)
|
|
384
|
+
INTERNATINAL_TRAIN = 15 # Internationaler Zug (z.B. IC und EC)
|
|
385
|
+
HIGH_SPEED_TRAIN = 16 # Hochgeschwindigkeitzüge (z.B. ICE)
|
|
386
|
+
RAIL_REPLACEMENT_TRANSPORT = 17 # Schienenersatzverkehr
|
|
387
|
+
SHUTTLE_TRAIN = 18 # Schuttlezug
|
|
388
|
+
CITIZEN_BUS = 19 # Bürgerbus
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
## LineRequestType
|
|
392
|
+
```python
|
|
393
|
+
class LineRequestType(IntEnum):
|
|
394
|
+
NONE = 0
|
|
395
|
+
DEPARTURE_MONITOR = 1
|
|
396
|
+
STOP_TIMETABLE = 2
|
|
397
|
+
TIMETABLE = 4
|
|
398
|
+
ROUTE_MAPS = 8
|
|
399
|
+
STATION_TIMETABLE = 16
|
|
381
400
|
```
|
|
382
401
|
|
|
383
402
|
## CoordFormat
|
|
@@ -3,7 +3,11 @@ LICENSE
|
|
|
3
3
|
README.md
|
|
4
4
|
examples.py
|
|
5
5
|
pyproject.toml
|
|
6
|
+
.github/labeler.yml
|
|
7
|
+
.github/release-drafter.yml
|
|
8
|
+
.github/workflows/labeler.yml
|
|
6
9
|
.github/workflows/python-package.yml
|
|
10
|
+
.github/workflows/release_drafter.yml
|
|
7
11
|
.vscode/settings.json
|
|
8
12
|
apyefa/__init__.py
|
|
9
13
|
apyefa/client.py
|
|
@@ -17,7 +21,6 @@ apyefa.egg-info/requires.txt
|
|
|
17
21
|
apyefa.egg-info/top_level.txt
|
|
18
22
|
apyefa/commands/__init__.py
|
|
19
23
|
apyefa/commands/command.py
|
|
20
|
-
apyefa/commands/command_add_info.py
|
|
21
24
|
apyefa/commands/command_departures.py
|
|
22
25
|
apyefa/commands/command_serving_lines.py
|
|
23
26
|
apyefa/commands/command_stop_finder.py
|
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "apyefa"
|
|
10
|
-
version = "0.0.
|
|
10
|
+
version = "0.0.5"
|
|
11
11
|
requires-python = ">= 3.11"
|
|
12
12
|
description = "Python API for EFA(Elektronische Fahrplanauskunft) async requests"
|
|
13
13
|
authors = [
|
|
@@ -37,6 +37,7 @@ tests = [
|
|
|
37
37
|
minversion = "6.0"
|
|
38
38
|
asyncio_mode="auto"
|
|
39
39
|
addopts = "-ra -q"
|
|
40
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
40
41
|
testpaths = [
|
|
41
42
|
"tests"
|
|
42
43
|
]
|
|
@@ -12,7 +12,7 @@ STOP_ID_PLAERRER: Final = "de:09564:704"
|
|
|
12
12
|
|
|
13
13
|
@pytest.fixture(scope="module")
|
|
14
14
|
def query_url():
|
|
15
|
-
return f"https://efa.vgn.de/vgnExt_oeffi/{NAME}?commonMacro={MACRO}&outputFormat=rapidJSON&name_dm={STOP_ID_PLAERRER}&
|
|
15
|
+
return f"https://efa.vgn.de/vgnExt_oeffi/{NAME}?commonMacro={MACRO}&outputFormat=rapidJSON&name_dm={STOP_ID_PLAERRER}&mode=direct&type_dm=stop"
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@pytest.fixture
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
|
-
from voluptuous import Any, Optional, Required, Schema
|
|
4
|
-
|
|
5
|
-
from apyefa.commands.command import Command
|
|
6
|
-
|
|
7
|
-
_LOGGER = logging.getLogger(__name__)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class CommandAdditionalInfo(Command):
|
|
11
|
-
def __init__(self) -> None:
|
|
12
|
-
super().__init__("XML_ADDINFO_REQUEST", "addinfo")
|
|
13
|
-
|
|
14
|
-
def parse(self, data: dict):
|
|
15
|
-
data = self._get_parser().parse(data)
|
|
16
|
-
|
|
17
|
-
result = []
|
|
18
|
-
|
|
19
|
-
return result
|
|
20
|
-
|
|
21
|
-
def _get_params_schema(self) -> Schema:
|
|
22
|
-
return Schema(
|
|
23
|
-
{
|
|
24
|
-
Required("outputFormat", default="rapidJSON"): Any("rapidJSON"),
|
|
25
|
-
Required("coordOutputFormat", default="WGS84"): Any("WGS84"),
|
|
26
|
-
Optional("filterDateValid"): str,
|
|
27
|
-
Optional("filterDateValidDay"): str,
|
|
28
|
-
Optional("filterDateValidMonth"): str,
|
|
29
|
-
Optional("filterDateValidYear"): str,
|
|
30
|
-
Optional("filterDateValidComponentsActive"): Any("0", "1", 0, 1),
|
|
31
|
-
Optional("filterPublicationStatus"): Any("current", "history"),
|
|
32
|
-
Optional("filterValidIntervalStart"): str,
|
|
33
|
-
Optional("filterValidIntervalEnd"): str,
|
|
34
|
-
Optional("filterOMC"): str,
|
|
35
|
-
Optional("filterOMC_PlaceID"): str,
|
|
36
|
-
Optional("filterLineNumberIntervalStart"): str,
|
|
37
|
-
Optional("filterLineNumberIntervalEnd"): str,
|
|
38
|
-
Optional("filterMOTType"): str,
|
|
39
|
-
Optional("filterPNLineDir"): str,
|
|
40
|
-
Optional("filterPNLineSub"): str,
|
|
41
|
-
Optional("itdLPxx_selLine"): str,
|
|
42
|
-
Optional("itdLPxx_selOperator"): str,
|
|
43
|
-
Optional("itdLPxx_selStop"): str,
|
|
44
|
-
Optional("line"): str,
|
|
45
|
-
Optional("filterInfoID"): str,
|
|
46
|
-
Optional("filterInfoType"): str,
|
|
47
|
-
Optional("filterPriority"): str,
|
|
48
|
-
Optional("filterProviderCode"): str,
|
|
49
|
-
Optional("filterSourceSystemName"): str,
|
|
50
|
-
}
|
|
51
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|