apyefa 1.0.1__py3-none-any.whl → 1.1.1__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/client.py +6 -6
- apyefa/data_classes.py +13 -5
- {apyefa-1.0.1.dist-info → apyefa-1.1.1.dist-info}/METADATA +5 -4
- {apyefa-1.0.1.dist-info → apyefa-1.1.1.dist-info}/RECORD +7 -7
- {apyefa-1.0.1.dist-info → apyefa-1.1.1.dist-info}/WHEEL +1 -1
- {apyefa-1.0.1.dist-info → apyefa-1.1.1.dist-info/licenses}/LICENSE +0 -0
- {apyefa-1.0.1.dist-info → apyefa-1.1.1.dist-info}/top_level.txt +0 -0
apyefa/client.py
CHANGED
|
@@ -130,17 +130,17 @@ class EfaClient:
|
|
|
130
130
|
|
|
131
131
|
return command.parse(response)[:limit]
|
|
132
132
|
|
|
133
|
-
async def
|
|
133
|
+
async def locations_by_coord(
|
|
134
134
|
self,
|
|
135
135
|
coord_x: float,
|
|
136
136
|
coord_y: float,
|
|
137
137
|
*,
|
|
138
138
|
format: CoordFormat = CoordFormat.WGS84,
|
|
139
|
-
limit: int = 10,
|
|
140
139
|
search_nearbly_stops: bool = False,
|
|
141
|
-
|
|
140
|
+
limit: int = 10,
|
|
141
|
+
) -> list[Location]:
|
|
142
142
|
"""
|
|
143
|
-
Asynchronously fetches
|
|
143
|
+
Asynchronously fetches locations based on given coordinates.
|
|
144
144
|
|
|
145
145
|
Args:
|
|
146
146
|
coord_x (float): The X coordinate (longitude).
|
|
@@ -150,9 +150,9 @@ class EfaClient:
|
|
|
150
150
|
search_nearbly_stops (bool, optional): Whether to search for nearby stops. Defaults to False.
|
|
151
151
|
|
|
152
152
|
Returns:
|
|
153
|
-
Location:
|
|
153
|
+
list[Location]: List of locations found based on the provided coordinates.
|
|
154
154
|
"""
|
|
155
|
-
_LOGGER.info("Request
|
|
155
|
+
_LOGGER.info("Request locations search by coordinates")
|
|
156
156
|
_LOGGER.debug(f"coord_x: {coord_x}")
|
|
157
157
|
_LOGGER.debug(f"coord_y: {coord_y}")
|
|
158
158
|
_LOGGER.debug(f"format: {format}")
|
apyefa/data_classes.py
CHANGED
|
@@ -122,7 +122,8 @@ _SCHEMA_PRODUCT = vol.Schema(
|
|
|
122
122
|
vol.Optional("id"): int,
|
|
123
123
|
vol.Optional("name"): str,
|
|
124
124
|
vol.Optional("iconId"): int,
|
|
125
|
-
}
|
|
125
|
+
},
|
|
126
|
+
extra=vol.ALLOW_EXTRA,
|
|
126
127
|
)
|
|
127
128
|
|
|
128
129
|
_SCHEMA_PARENT = vol.Schema(
|
|
@@ -136,7 +137,8 @@ _SCHEMA_PARENT = vol.Schema(
|
|
|
136
137
|
vol.Optional("disassembledName"): str,
|
|
137
138
|
vol.Optional("parent"): vol.Self,
|
|
138
139
|
vol.Optional("properties"): _SCHEMA_PROPERTIES,
|
|
139
|
-
}
|
|
140
|
+
},
|
|
141
|
+
extra=vol.ALLOW_EXTRA,
|
|
140
142
|
)
|
|
141
143
|
|
|
142
144
|
_SCHEMA_OPERATOR = vol.Schema(
|
|
@@ -144,7 +146,8 @@ _SCHEMA_OPERATOR = vol.Schema(
|
|
|
144
146
|
vol.Required("id"): str,
|
|
145
147
|
vol.Required("name"): str,
|
|
146
148
|
vol.Optional("code"): str,
|
|
147
|
-
}
|
|
149
|
+
},
|
|
150
|
+
extra=vol.ALLOW_EXTRA,
|
|
148
151
|
)
|
|
149
152
|
|
|
150
153
|
_SCHEMA_LOCATION: Final = vol.Schema(
|
|
@@ -201,7 +204,8 @@ _SCHEMA_SYSTEM_INFO: Final = vol.Schema(
|
|
|
201
204
|
vol.Required("to"): vol.Date("%Y-%m-%d"),
|
|
202
205
|
}
|
|
203
206
|
),
|
|
204
|
-
}
|
|
207
|
+
},
|
|
208
|
+
extra=vol.ALLOW_EXTRA,
|
|
205
209
|
)
|
|
206
210
|
|
|
207
211
|
_SCHEMA_DEPARTURE: Final = vol.Schema(
|
|
@@ -240,7 +244,8 @@ _SCHEMA_LEG: Final = vol.Schema(
|
|
|
240
244
|
vol.Optional("isRealtimeControlled"): vol.Boolean,
|
|
241
245
|
vol.Optional("realtimeStatus"): list,
|
|
242
246
|
vol.Optional("footPathInfo"): list,
|
|
243
|
-
}
|
|
247
|
+
},
|
|
248
|
+
extra=vol.ALLOW_EXTRA,
|
|
244
249
|
)
|
|
245
250
|
|
|
246
251
|
|
|
@@ -345,6 +350,7 @@ class Location(_Base):
|
|
|
345
350
|
@dataclass(frozen=True)
|
|
346
351
|
class Departure(_Base):
|
|
347
352
|
location: Location = field(repr=False)
|
|
353
|
+
line_id: str
|
|
348
354
|
line_name: str
|
|
349
355
|
route: str
|
|
350
356
|
origin: Location
|
|
@@ -375,6 +381,7 @@ class Departure(_Base):
|
|
|
375
381
|
hints = data.get("hints")
|
|
376
382
|
|
|
377
383
|
line = Line.from_dict(data.get("transportation"))
|
|
384
|
+
line_id = line.id
|
|
378
385
|
line_name = line.name
|
|
379
386
|
transport = line.product
|
|
380
387
|
origin = line.origin
|
|
@@ -384,6 +391,7 @@ class Departure(_Base):
|
|
|
384
391
|
return Departure(
|
|
385
392
|
data,
|
|
386
393
|
location,
|
|
394
|
+
line_id,
|
|
387
395
|
line_name,
|
|
388
396
|
route,
|
|
389
397
|
origin,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: apyefa
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
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
|
|
@@ -42,6 +42,7 @@ Requires-Dist: pytest; extra == "tests"
|
|
|
42
42
|
Requires-Dist: pytest-asyncio>=0.24.0; extra == "tests"
|
|
43
43
|
Requires-Dist: pytest-benchmark[histogram]>=3.2.1; extra == "tests"
|
|
44
44
|
Requires-Dist: requests>=2.32.3; extra == "tests"
|
|
45
|
+
Dynamic: license-file
|
|
45
46
|
|
|
46
47
|
# apyefa
|
|
47
48
|
[](https://github.com/alex-jung/apyefa/actions/workflows/python-package.yml)
|
|
@@ -79,8 +80,8 @@ pip install .
|
|
|
79
80
|
|Function Name |Description|
|
|
80
81
|
|----------------------------------------------------|-----------|
|
|
81
82
|
|[info()](https://github.com/alex-jung/apyefa/wiki/info)|Provides EFA endpoint system information|
|
|
82
|
-
|[locations_by_name()](https://github.com/alex-jung/apyefa/wiki/locations_by_name)|Search for locations by name with optional filters
|
|
83
|
-
|[
|
|
83
|
+
|[locations_by_name()](https://github.com/alex-jung/apyefa/wiki/locations_by_name)|Search for locations by name with optional filters|
|
|
84
|
+
|[locations_by_coord()](https://github.com/alex-jung/apyefa/wiki/locations_by_coord)|Search for locations by coordinates|
|
|
84
85
|
|[list_lines()](https://github.com/alex-jung/apyefa/wiki/list_lines)|Retrieves a list of lines|
|
|
85
86
|
|[list_stops()](https://github.com/alex-jung/apyefa/wiki/list_stops)|Retrieves a list of stops|
|
|
86
87
|
|[trip()](https://github.com/alex-jung/apyefa/wiki/trip)|Calculates a trip between an origin and a destination locations|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
apyefa/__init__.py,sha256=9LuZCm4L02Jz-rgvSyTSQ10fzMEZ0P2nWQQ6m3Z9Ab0,386
|
|
2
|
-
apyefa/client.py,sha256=
|
|
3
|
-
apyefa/data_classes.py,sha256=
|
|
2
|
+
apyefa/client.py,sha256=CEwWuHFBTUfgGszQVXAogWUQ-JY-Ew7zMidB7oR2AD0,27228
|
|
3
|
+
apyefa/data_classes.py,sha256=psDqVYtxevyem0z2U0_9v2O-owM2nEyJ9LvoLZTmVkM,15172
|
|
4
4
|
apyefa/exceptions.py,sha256=Vhc8FEtI1xSxbVRLFXd3BlNTekY2w3byEvd3Jhhg8h4,240
|
|
5
5
|
apyefa/helpers.py,sha256=WGXQ2SwlQ5IB57_ab0ry3QAqL-iDWqtOOwP0yhQI5ck,3531
|
|
6
6
|
apyefa/commands/__init__.py,sha256=h5cyzFXA6vJQgUx7LyngoXxXo11ULvVku9GFuVwvkic,848
|
|
@@ -20,8 +20,8 @@ apyefa/commands/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
20
20
|
apyefa/commands/parsers/parser.py,sha256=1PSlLpfYrNeKRTpvCcYsCzAKlNrs0oHvSN7zpF4Xcs8,140
|
|
21
21
|
apyefa/commands/parsers/rapid_json_parser.py,sha256=UMexRiMKkJLcK5EEj80B6RYkWBuR8ZWD3YpeGa0J3lQ,212
|
|
22
22
|
apyefa/commands/parsers/xml_parser.py,sha256=ru52QtBP68KoTZ8OgjFWrLy-PD4_j1miY8Zv5umNSE8,151
|
|
23
|
-
apyefa-1.
|
|
24
|
-
apyefa-1.
|
|
25
|
-
apyefa-1.
|
|
26
|
-
apyefa-1.
|
|
27
|
-
apyefa-1.
|
|
23
|
+
apyefa-1.1.1.dist-info/licenses/LICENSE,sha256=C2Gdvb1B39BeEP-RGqVd7w6j94GnJo4gnYyiC_l3SFQ,1066
|
|
24
|
+
apyefa-1.1.1.dist-info/METADATA,sha256=kHat6_Js3kVlZCynIWoH4APkK35ybxW8SZ9eNY3AOrI,6122
|
|
25
|
+
apyefa-1.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
apyefa-1.1.1.dist-info/top_level.txt,sha256=b9VSv2S7lxdaypCumxO92IEQFpJdFuB8vQs03j5gZxY,7
|
|
27
|
+
apyefa-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|