apyefa 0.0.5__py3-none-any.whl → 0.0.7__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 apyefa might be problematic. Click here for more details.

apyefa/__init__.py CHANGED
@@ -2,6 +2,7 @@ from apyefa.client import EfaClient
2
2
  from apyefa.data_classes import (
3
3
  Departure,
4
4
  Line,
5
+ LineRequestType,
5
6
  Location,
6
7
  LocationFilter,
7
8
  LocationType,
@@ -12,6 +13,7 @@ from apyefa.data_classes import (
12
13
  __all__ = [
13
14
  "LocationFilter",
14
15
  "Location",
16
+ "LineRequestType",
15
17
  "LocationType",
16
18
  "Departure",
17
19
  "SystemInfo",
apyefa/client.py CHANGED
@@ -79,14 +79,13 @@ class EfaClient:
79
79
  _LOGGER.debug(f"limit: {limit}")
80
80
 
81
81
  command = CommandStopFinder("any", name)
82
- command.add_param("anyMaxSizeHitList", limit)
83
82
 
84
83
  if filters:
85
84
  command.add_param("anyObjFilter_sf", sum(filters))
86
85
 
87
86
  response = await self._run_query(self._build_url(command))
88
87
 
89
- return command.parse(response)
88
+ return command.parse(response)[:limit]
90
89
 
91
90
  async def location_by_coord(
92
91
  self,
@@ -113,11 +112,10 @@ class EfaClient:
113
112
  _LOGGER.debug(f"limit: {limit}")
114
113
 
115
114
  command = CommandStopFinder("coord", f"{coord_x}:{coord_y}:{format}")
116
- command.add_param("anyMaxSizeHitList", limit)
117
115
 
118
116
  response = await self._run_query(self._build_url(command))
119
117
 
120
- return command.parse(response)
118
+ return command.parse(response)[:limit]
121
119
 
122
120
  async def trip(self):
123
121
  raise NotImplementedError
@@ -7,6 +7,8 @@ from apyefa.commands.parsers.rapid_json_parser import RapidJsonParser
7
7
  from apyefa.exceptions import EfaFormatNotSupported, EfaParameterError
8
8
  from apyefa.helpers import is_date, is_datetime, is_time
9
9
 
10
+ from ..data_classes import CoordFormat
11
+
10
12
  _LOGGER = logging.getLogger(__name__)
11
13
 
12
14
 
@@ -18,7 +20,7 @@ class Command:
18
20
  self._format: str = output_format
19
21
 
20
22
  self.add_param("outputFormat", output_format)
21
- self.add_param("coordOutputFormat", "WGS84")
23
+ self.add_param("coordOutputFormat", CoordFormat.WGS84.value)
22
24
 
23
25
  def add_param(self, param: str, value: str):
24
26
  if not param or not value:
@@ -3,7 +3,7 @@ import logging
3
3
  from voluptuous import Any, Date, Datetime, Optional, Required, Schema
4
4
 
5
5
  from apyefa.commands.command import Command
6
- from apyefa.data_classes import Departure
6
+ from apyefa.data_classes import CoordFormat, Departure
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
9
9
 
@@ -32,7 +32,9 @@ class CommandDepartures(Command):
32
32
  return Schema(
33
33
  {
34
34
  Required("outputFormat", default="rapidJSON"): Any("rapidJSON"),
35
- Required("coordOutputFormat", default="WGS84"): Any("WGS84"),
35
+ Required("coordOutputFormat", default="WGS84"): Any(
36
+ *[x.value for x in CoordFormat]
37
+ ),
36
38
  Required("name_dm"): str,
37
39
  Required("type_dm", default="stop"): Any("any", "stop"),
38
40
  Required("mode", default="direct"): Any("any", "direct"),
@@ -3,7 +3,7 @@ import logging
3
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, LineRequestType
6
+ from apyefa.data_classes import CoordFormat, Line, LineRequestType
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
9
9
 
@@ -41,7 +41,9 @@ class CommandServingLines(Command):
41
41
  return Schema(
42
42
  {
43
43
  Required("outputFormat", default="rapidJSON"): Any("rapidJSON"),
44
- Required("coordOutputFormat", default="WGS84"): Any("WGS84"),
44
+ Required("coordOutputFormat", default="WGS84"): Any(
45
+ *[x.value for x in CoordFormat]
46
+ ),
45
47
  Required("mode", default="line"): Any("odv", "line"),
46
48
  # mode 'odv'
47
49
  Optional("type_sl"): Any("stopID"),
@@ -3,7 +3,7 @@ import logging
3
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 Location, LocationFilter
6
+ from apyefa.data_classes import CoordFormat, Location, LocationFilter
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
9
9
 
@@ -33,7 +33,9 @@ class CommandStopFinder(Command):
33
33
  return Schema(
34
34
  {
35
35
  Required("outputFormat", default="rapidJSON"): Any("rapidJSON"),
36
- Required("coordOutputFormat", default="WGS84"): Any("WGS84"),
36
+ Required("coordOutputFormat", default="WGS84"): Any(
37
+ *[x.value for x in CoordFormat]
38
+ ),
37
39
  Required("type_sf", default="any"): Any("any", "coord"),
38
40
  Required("name_sf"): str,
39
41
  Optional("anyMaxSizeHitList"): int,
@@ -41,6 +43,10 @@ class CommandStopFinder(Command):
41
43
  Optional("anyResSort_sf"): str,
42
44
  Optional("anyObjFilter_sf"): int,
43
45
  Optional("doNotSearchForStops_sf"): Any("0", "1", 0, 1),
46
+ Optional("locationInfoActive_sf"): Any("0", "1", 0, 1),
47
+ Optional("useHouseNumberList_sf"): Any("0", "1", 0, 1),
48
+ Optional("useLocalityMainStop"): Any("0", "1", 0, 1),
49
+ Optional("prMinQu"): int,
44
50
  Optional("anyObjFilter_origin"): Range(
45
51
  min=0, max=sum([x.value for x in LocationFilter])
46
52
  ),
@@ -3,7 +3,7 @@ import logging
3
3
  from voluptuous import Any, Optional, Required, Schema
4
4
 
5
5
  from apyefa.commands.command import Command
6
- from apyefa.data_classes import SystemInfo
6
+ from apyefa.data_classes import CoordFormat, SystemInfo
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
9
9
 
@@ -23,6 +23,8 @@ class CommandSystemInfo(Command):
23
23
  return Schema(
24
24
  {
25
25
  Required("outputFormat", default="rapidJSON"): Any("rapidJSON"),
26
- Optional("coordOutputFormat", default="WGS84"): Any("WGS84"),
26
+ Optional("coordOutputFormat", default="WGS84"): Any(
27
+ *[x.value for x in CoordFormat]
28
+ ),
27
29
  }
28
30
  )
@@ -4,6 +4,8 @@ from voluptuous import Any, Optional, Required, Schema
4
4
 
5
5
  from apyefa.commands.command import Command
6
6
 
7
+ from ..data_classes import CoordFormat
8
+
7
9
  _LOGGER = logging.getLogger(__name__)
8
10
 
9
11
 
@@ -18,7 +20,9 @@ class CommandTrip(Command):
18
20
  return Schema(
19
21
  {
20
22
  Required("outputFormat", default="rapidJSON"): Any("rapidJSON"),
21
- Required("coordOutputFormat", default="WGS84"): Any("WGS84"),
23
+ Required("coordOutputFormat", default="WGS84"): Any(
24
+ *[x.value for x in CoordFormat]
25
+ ),
22
26
  Required("type_origin", default="any"): Any("any", "coord"),
23
27
  Required("name_origin"): str,
24
28
  Required("type_destination", default="any"): Any("any", "coord"),
apyefa/data_classes.py CHANGED
@@ -97,7 +97,7 @@ def IsLocationType(type: str):
97
97
 
98
98
  SCHEMA_PROPERTIES = vol.Schema(
99
99
  {
100
- vol.Required("stopId"): str,
100
+ vol.Optional("stopId"): str,
101
101
  vol.Optional("downloads"): list,
102
102
  vol.Optional("area"): str,
103
103
  vol.Optional("platform"): str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apyefa
3
- Version: 0.0.5
3
+ Version: 0.0.7
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
@@ -185,16 +185,14 @@ async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
185
185
  ```
186
186
 
187
187
  ## locations_by_coord()
188
- Find localities by coordinates.
189
-
190
- > :x: Currently test endpoint does not sent any answers for this request
188
+ Find localities by their coordinates.
191
189
 
192
190
  ### Arguments
193
191
  |Arguments|Type |Required|Description|
194
192
  |---------|--------------------|--------|-----------|
195
193
  |coord_x |float |required|X-coordinate|
196
194
  |coord_y |float |required|Y-coordinate|
197
- |format |[CoordFormat](#coordformat)|optional|Coordinates format used for request|
195
+ |format |[CoordFormat](#coordformat)|optional|Coordinates format used for request. Default to WGS84.|
198
196
  |limit |int |optional|Max size of returned list. Default value is `10`|
199
197
 
200
198
  ### Return value
@@ -0,0 +1,21 @@
1
+ apyefa/__init__.py,sha256=9LuZCm4L02Jz-rgvSyTSQ10fzMEZ0P2nWQQ6m3Z9Ab0,386
2
+ apyefa/client.py,sha256=OP9HnzwufH9joS-Bx7r768yu185ILbpVFGuYV2APjQ0,6832
3
+ apyefa/data_classes.py,sha256=gw89j_cr5rRfNx2GFxYDDV52dcdW5ao9N_aebcuul0I,11552
4
+ apyefa/exceptions.py,sha256=Vhc8FEtI1xSxbVRLFXd3BlNTekY2w3byEvd3Jhhg8h4,240
5
+ apyefa/helpers.py,sha256=EJyj-Pw3xDrn8WKGbpfqbnaUZjHtVrE2A2LYpTkACps,1695
6
+ apyefa/commands/__init__.py,sha256=kC7Zr8IcahAN8xEOytDUS6WCADQ5oe_nqDIPAjlzxy4,425
7
+ apyefa/commands/command.py,sha256=ruVb8kpvsShsfT4wrgwcCdxqlGnYs4jsXTEoYx873rk,3633
8
+ apyefa/commands/command_departures.py,sha256=kYt6GbXD1XYXEbGpi61TEFBTznqShyOaqJmpRi0mHZ4,1811
9
+ apyefa/commands/command_serving_lines.py,sha256=PSWjr0el4bhq20IaW_P56q8sJ3vNlfV-KpoAUjrsHqo,2212
10
+ apyefa/commands/command_stop_finder.py,sha256=lUkubSe7mVu8M6rss-RumnCPOaJJo_v6qlRNF7n6R88,2019
11
+ apyefa/commands/command_system_info.py,sha256=rhAoeOE8V9Wc3G6z7NDrB9pjcULDz1o7oo-idS4VyXQ,858
12
+ apyefa/commands/command_trip.py,sha256=Mhqv7wR11DtvxfaZSmNF-hLZxgC3XFH3UgBuI2fFEBA,1197
13
+ apyefa/commands/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ apyefa/commands/parsers/parser.py,sha256=1PSlLpfYrNeKRTpvCcYsCzAKlNrs0oHvSN7zpF4Xcs8,140
15
+ apyefa/commands/parsers/rapid_json_parser.py,sha256=UMexRiMKkJLcK5EEj80B6RYkWBuR8ZWD3YpeGa0J3lQ,212
16
+ apyefa/commands/parsers/xml_parser.py,sha256=ru52QtBP68KoTZ8OgjFWrLy-PD4_j1miY8Zv5umNSE8,151
17
+ apyefa-0.0.7.dist-info/LICENSE,sha256=C2Gdvb1B39BeEP-RGqVd7w6j94GnJo4gnYyiC_l3SFQ,1066
18
+ apyefa-0.0.7.dist-info/METADATA,sha256=rI_SnnRqdCS4AwgpaNSnPISlPhBECjtwCcpJh5E97ho,16701
19
+ apyefa-0.0.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
+ apyefa-0.0.7.dist-info/top_level.txt,sha256=b9VSv2S7lxdaypCumxO92IEQFpJdFuB8vQs03j5gZxY,7
21
+ apyefa-0.0.7.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- apyefa/__init__.py,sha256=kohSwa1VlugPyxKa0QZqQFwRi4hIGrKFd74W7NDgunA,342
2
- apyefa/client.py,sha256=UYt1kvxvPjg-VfdlUqPsazyEdc97J27_DMoprjF8C8g,6924
3
- apyefa/data_classes.py,sha256=Njt7r8ONEY5KxUz9uVFnPHU9qz9sp5RWmmhiR8ywDiY,11552
4
- apyefa/exceptions.py,sha256=Vhc8FEtI1xSxbVRLFXd3BlNTekY2w3byEvd3Jhhg8h4,240
5
- apyefa/helpers.py,sha256=EJyj-Pw3xDrn8WKGbpfqbnaUZjHtVrE2A2LYpTkACps,1695
6
- apyefa/commands/__init__.py,sha256=kC7Zr8IcahAN8xEOytDUS6WCADQ5oe_nqDIPAjlzxy4,425
7
- apyefa/commands/command.py,sha256=wq3rEaYd3NUpkNqo2sX3Yw9-lcRerp8scAy2SVpx1hs,3577
8
- apyefa/commands/command_departures.py,sha256=kHOyxxSHn7F7ClAV1fQdl1O4cOVRs6a60pkqc8-r_9o,1736
9
- apyefa/commands/command_serving_lines.py,sha256=V-HVYgFyeEWBLebKbp6NNXshxw0fVPttGZLu-CTmFC4,2137
10
- apyefa/commands/command_stop_finder.py,sha256=oDCbjVoQVK_ARDEdmHXuaUJ-IJA0P6f99cVDRS2hqT8,1688
11
- apyefa/commands/command_system_info.py,sha256=0bQ0oYbp7FFqPA1b5RgaxANm9-BYlN5KiwRILCCuDVY,783
12
- apyefa/commands/command_trip.py,sha256=kOlchWyBRlvWBqwjqpx130VXEh5kly6KMSv_pgCBljs,1095
13
- apyefa/commands/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- apyefa/commands/parsers/parser.py,sha256=1PSlLpfYrNeKRTpvCcYsCzAKlNrs0oHvSN7zpF4Xcs8,140
15
- apyefa/commands/parsers/rapid_json_parser.py,sha256=UMexRiMKkJLcK5EEj80B6RYkWBuR8ZWD3YpeGa0J3lQ,212
16
- apyefa/commands/parsers/xml_parser.py,sha256=ru52QtBP68KoTZ8OgjFWrLy-PD4_j1miY8Zv5umNSE8,151
17
- apyefa-0.0.5.dist-info/LICENSE,sha256=C2Gdvb1B39BeEP-RGqVd7w6j94GnJo4gnYyiC_l3SFQ,1066
18
- apyefa-0.0.5.dist-info/METADATA,sha256=bop1VP_hhMO9A_9inje-HerUa1uArdE2jkvA1mZUHa0,16750
19
- apyefa-0.0.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
- apyefa-0.0.5.dist-info/top_level.txt,sha256=b9VSv2S7lxdaypCumxO92IEQFpJdFuB8vQs03j5gZxY,7
21
- apyefa-0.0.5.dist-info/RECORD,,
File without changes