python-openpublictransport 0.3.1__tar.gz → 0.3.2__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.1 → python_openpublictransport-0.3.2}/PKG-INFO +1 -1
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/pyproject.toml +1 -1
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/hafas_mgate_base.py +7 -3
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/python_openpublictransport.egg-info/PKG-INFO +1 -1
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_german_regional_providers.py +19 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/setup.cfg +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/__init__.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/const.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/data/uk_stations.json +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/exceptions.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/models.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/parsers.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/__init__.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/avv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/bart.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/beg.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/bsvg.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/bvg.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/cta.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/dart.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/db.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/digitransit.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/ding.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/efa_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/entur.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/fptf_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/golemio.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/gvh.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/hafas_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/hongkong.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/hvv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/hvv_gti.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/insa.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/irail.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/irishrail.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/kvv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/mobiliteit_lu.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/mvv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/nahsh.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/national_rail.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/nextbus_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/ns.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/nta.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/nvbw.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/nvv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/nwl.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/oebb.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/otp.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/otp_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/otp_custom.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/rejseplanen.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/rmv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/rvv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/saarvv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/sbb.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/sl.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/tfl.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/tfnsw.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/tpg.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/trafiklab.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/transitous.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/trias_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/trimet.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/ttc.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vagfr.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vao.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vbn.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vbn_hafas.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vgn.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vmt.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vmv.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vos.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vrn.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vrr.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vsn.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vvo.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/vvs.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/providers/wienerlinien.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/openpublictransport/py.typed +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/python_openpublictransport.egg-info/SOURCES.txt +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/python_openpublictransport.egg-info/dependency_links.txt +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/python_openpublictransport.egg-info/requires.txt +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/src/python_openpublictransport.egg-info/top_level.txt +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_cta.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_digitransit.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_efa_mimetype.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_efa_platform.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_entur.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_golemio.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hafas_base.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hafas_mgate.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hongkong.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_http_errors.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hvv_gti.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_irail.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_issue_fixes_0_3_1.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_national_rail.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_national_rail_parse.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_national_rail_static.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_provider_expansion.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_sbb.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_sl.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_tfl.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_tfnsw.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_ttc.py +0 -0
- {python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/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.2"
|
|
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" }
|
|
@@ -327,11 +327,15 @@ class HafasMgateBaseProvider(BaseProvider):
|
|
|
327
327
|
destination_id: str,
|
|
328
328
|
departure_time: Optional[datetime] = None,
|
|
329
329
|
results: int = 4,
|
|
330
|
+
arrival_time: Optional[datetime] = None,
|
|
330
331
|
) -> List[Dict[str, Any]]:
|
|
331
332
|
"""Plan journeys between two stops with the mgate ``TripSearch`` service.
|
|
332
333
|
|
|
333
334
|
``departure_time`` is converted to the network's time zone; without it
|
|
334
|
-
the search starts now.
|
|
335
|
+
the search starts now. ``arrival_time`` switches to an "arrive by"
|
|
336
|
+
search instead (like hafas-client's ``arrival`` option, ``outFrwd``
|
|
337
|
+
false): the connections that arrive by then. It wins over
|
|
338
|
+
``departure_time``. Returns one dict per connection::
|
|
335
339
|
|
|
336
340
|
{"duration_minutes": int, "transfers": int, "legs": [leg, ...]}
|
|
337
341
|
|
|
@@ -342,7 +346,7 @@ class HafasMgateBaseProvider(BaseProvider):
|
|
|
342
346
|
(the unprefixed ones are real-time when the network reports it).
|
|
343
347
|
"""
|
|
344
348
|
tz = ZoneInfo(self.timezone)
|
|
345
|
-
when = (departure_time or datetime.now(tz)).astimezone(tz)
|
|
349
|
+
when = (arrival_time or departure_time or datetime.now(tz)).astimezone(tz)
|
|
346
350
|
svc = {
|
|
347
351
|
"meth": "TripSearch",
|
|
348
352
|
"req": {
|
|
@@ -350,7 +354,7 @@ class HafasMgateBaseProvider(BaseProvider):
|
|
|
350
354
|
"arrLocL": [self._location(destination_id)],
|
|
351
355
|
"outDate": when.strftime("%Y%m%d"),
|
|
352
356
|
"outTime": when.strftime("%H%M%S"),
|
|
353
|
-
"outFrwd":
|
|
357
|
+
"outFrwd": arrival_time is None,
|
|
354
358
|
"numF": results,
|
|
355
359
|
"getPasslist": False,
|
|
356
360
|
"getPolyline": False,
|
|
@@ -202,3 +202,22 @@ async def test_search_trips_with_extid_and_empty_result():
|
|
|
202
202
|
def test_german_category_labels(cat_out, cat_out_l, expected):
|
|
203
203
|
prod = {"prodCtx": {"catOut": cat_out, "catOutL": cat_out_l}}
|
|
204
204
|
assert VMTProvider(session=None)._transport_type(prod) == expected
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
async def test_search_trips_arrive_by():
|
|
208
|
+
provider = NAHSHProvider(session=None)
|
|
209
|
+
provider._request = AsyncMock(return_value={"svcResL": [{"res": {}}]})
|
|
210
|
+
|
|
211
|
+
await provider.search_trips("A=1@L=1@", "A=1@L=2@", arrival_time=datetime(2026, 10, 17, 6, 0, tzinfo=ZoneInfo("UTC")))
|
|
212
|
+
|
|
213
|
+
req = json.loads(provider._request.call_args.kwargs["data"])["svcReqL"][0]["req"]
|
|
214
|
+
assert req["outFrwd"] is False
|
|
215
|
+
# 06:00 UTC is 08:00 in Berlin
|
|
216
|
+
assert (req["outDate"], req["outTime"]) == ("20261017", "080000")
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
async def test_search_trips_departure_stays_forward():
|
|
220
|
+
provider = NAHSHProvider(session=None)
|
|
221
|
+
provider._request = AsyncMock(return_value={"svcResL": [{"res": {}}]})
|
|
222
|
+
await provider.search_trips("A=1@L=1@", "A=1@L=2@")
|
|
223
|
+
assert json.loads(provider._request.call_args.kwargs["data"])["svcReqL"][0]["req"]["outFrwd"] is True
|
|
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.1 → python_openpublictransport-0.3.2}/tests/test_digitransit.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_efa_mimetype.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_efa_platform.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hafas_base.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hafas_mgate.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_hongkong.py
RENAMED
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/tests/test_http_errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_openpublictransport-0.3.1 → python_openpublictransport-0.3.2}/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.1 → python_openpublictransport-0.3.2}/tests/test_wienerlinien.py
RENAMED
|
File without changes
|