python-openpublictransport 0.3.3__tar.gz → 0.3.4__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.
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/PKG-INFO +1 -1
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/pyproject.toml +1 -1
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/hafas_mgate_base.py +13 -1
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/python_openpublictransport.egg-info/PKG-INFO +1 -1
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_german_regional_providers.py +21 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/setup.cfg +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/__init__.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/const.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/data/uk_stations.json +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/exceptions.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/models.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/parsers.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/__init__.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/avv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/bart.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/beg.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/bsvg.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/bvg.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/cta.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/dart.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/db.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/digitransit.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/ding.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/efa_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/entur.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/fptf_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/golemio.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/gvh.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/hafas_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/hongkong.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/hvv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/hvv_gti.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/insa.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/irail.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/irishrail.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/kvv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/mobiliteit_lu.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/mvv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/nahsh.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/national_rail.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/nextbus_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/ns.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/nta.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/nvbw.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/nvv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/nwl.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/oebb.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/otp.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/otp_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/otp_custom.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/rejseplanen.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/rmv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/rvv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/saarvv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/sbb.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/sl.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/tfl.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/tfnsw.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/tpg.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/trafiklab.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/transitous.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/trias_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/trimet.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/ttc.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vagfr.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vao.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vbn.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vbn_hafas.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vgn.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vmt.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vmv.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vos.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vrn.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vrr.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vsn.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vvo.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/vvs.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/providers/wienerlinien.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/openpublictransport/py.typed +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/python_openpublictransport.egg-info/SOURCES.txt +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/python_openpublictransport.egg-info/dependency_links.txt +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/python_openpublictransport.egg-info/requires.txt +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/src/python_openpublictransport.egg-info/top_level.txt +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_cta.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_digitransit.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_disruptions.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_efa_mimetype.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_efa_platform.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_entur.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_golemio.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hafas_base.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hafas_mgate.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hongkong.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_http_errors.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hvv_gti.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_irail.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_issue_fixes_0_3_1.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_national_rail.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_national_rail_parse.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_national_rail_static.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_provider_expansion.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_sbb.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_sl.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_tfl.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_tfnsw.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_ttc.py +0 -0
- {python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_wienerlinien.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-openpublictransport"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.4"
|
|
8
8
|
description = "Python library for public transport APIs (EFA, OTP2, TRIAS, FPTF, HAFAS, GTFS-RT)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -328,6 +328,8 @@ class HafasMgateBaseProvider(BaseProvider):
|
|
|
328
328
|
departure_time: Optional[datetime] = None,
|
|
329
329
|
results: int = 4,
|
|
330
330
|
arrival_time: Optional[datetime] = None,
|
|
331
|
+
via_id: Optional[str] = None,
|
|
332
|
+
via_dwell_minutes: Optional[int] = None,
|
|
331
333
|
) -> List[Dict[str, Any]]:
|
|
332
334
|
"""Plan journeys between two stops with the mgate ``TripSearch`` service.
|
|
333
335
|
|
|
@@ -335,7 +337,12 @@ class HafasMgateBaseProvider(BaseProvider):
|
|
|
335
337
|
the search starts now. ``arrival_time`` switches to an "arrive by"
|
|
336
338
|
search instead (like hafas-client's ``arrival`` option, ``outFrwd``
|
|
337
339
|
false): the connections that arrive by then. It wins over
|
|
338
|
-
``departure_time``.
|
|
340
|
+
``departure_time``.
|
|
341
|
+
|
|
342
|
+
``via_id`` routes every connection through that stop (mgate
|
|
343
|
+
``viaLocL``); ``via_dwell_minutes`` asks for at least that long a stay
|
|
344
|
+
there (the entry's ``min``). Without a via the dwell time is ignored.
|
|
345
|
+
Returns one dict per connection::
|
|
339
346
|
|
|
340
347
|
{"duration_minutes": int, "transfers": int, "legs": [leg, ...]}
|
|
341
348
|
|
|
@@ -360,6 +367,11 @@ class HafasMgateBaseProvider(BaseProvider):
|
|
|
360
367
|
"getPolyline": False,
|
|
361
368
|
},
|
|
362
369
|
}
|
|
370
|
+
if via_id:
|
|
371
|
+
via: Dict[str, Any] = {"loc": self._location(via_id)}
|
|
372
|
+
if via_dwell_minutes and via_dwell_minutes > 0:
|
|
373
|
+
via["min"] = int(via_dwell_minutes)
|
|
374
|
+
svc["req"]["viaLocL"] = [via]
|
|
363
375
|
res = await self._mgate_request(svc)
|
|
364
376
|
if not res:
|
|
365
377
|
return []
|
|
@@ -221,3 +221,24 @@ async def test_search_trips_departure_stays_forward():
|
|
|
221
221
|
provider._request = AsyncMock(return_value={"svcResL": [{"res": {}}]})
|
|
222
222
|
await provider.search_trips("A=1@L=1@", "A=1@L=2@")
|
|
223
223
|
assert json.loads(provider._request.call_args.kwargs["data"])["svcReqL"][0]["req"]["outFrwd"] is True
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
async def test_search_trips_via_with_dwell_time():
|
|
227
|
+
"""A via stop goes into viaLocL; a dwell time becomes its minimum stay."""
|
|
228
|
+
provider = NAHSHProvider(session=None)
|
|
229
|
+
provider._request = AsyncMock(return_value={"svcResL": [{"res": {}}]})
|
|
230
|
+
|
|
231
|
+
await provider.search_trips("A=1@L=1@", "A=1@L=2@", via_id="A=1@L=3@", via_dwell_minutes=30)
|
|
232
|
+
req = json.loads(provider._request.call_args.kwargs["data"])["svcReqL"][0]["req"]
|
|
233
|
+
assert req["viaLocL"] == [{"loc": {"lid": "A=1@L=3@"}, "min": 30}]
|
|
234
|
+
|
|
235
|
+
await provider.search_trips("A=1@L=1@", "A=1@L=2@", via_id="8000323")
|
|
236
|
+
req = json.loads(provider._request.call_args.kwargs["data"])["svcReqL"][0]["req"]
|
|
237
|
+
assert req["viaLocL"] == [{"loc": {"type": "S", "extId": "8000323"}}]
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
async def test_search_trips_without_via_sends_no_via():
|
|
241
|
+
provider = NAHSHProvider(session=None)
|
|
242
|
+
provider._request = AsyncMock(return_value={"svcResL": [{"res": {}}]})
|
|
243
|
+
await provider.search_trips("A=1@L=1@", "A=1@L=2@", via_dwell_minutes=15)
|
|
244
|
+
assert "viaLocL" not in json.loads(provider._request.call_args.kwargs["data"])["svcReqL"][0]["req"]
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_digitransit.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_disruptions.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_efa_mimetype.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_efa_platform.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hafas_base.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hafas_mgate.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_hongkong.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_http_errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_national_rail.py
RENAMED
|
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
|
{python_openpublictransport-0.3.3 → python_openpublictransport-0.3.4}/tests/test_wienerlinien.py
RENAMED
|
File without changes
|