python-opendata-transport 0.4.0__tar.gz → 0.5.0__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_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/.github/workflows/python.yml +3 -3
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/.gitignore +3 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/CHANGES.txt +8 -1
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/LICENSE +1 -1
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/PKG-INFO +5 -4
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/opendata_transport/__init__.py +20 -16
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/python_opendata_transport.egg-info/PKG-INFO +6 -5
- python_opendata_transport-0.5.0/python_opendata_transport.egg-info/requires.txt +2 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/setup.py +4 -5
- python_opendata_transport-0.4.0/python_opendata_transport.egg-info/requires.txt +0 -2
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/MANIFEST.in +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/README.rst +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/example.py +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/opendata_transport/exceptions.py +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/python_opendata_transport.egg-info/SOURCES.txt +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/python_opendata_transport.egg-info/dependency_links.txt +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/python_opendata_transport.egg-info/top_level.txt +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/python_opendata_transport.egg-info/zip-safe +0 -0
- {python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/setup.cfg +0 -0
{python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/.github/workflows/python.yml
RENAMED
|
@@ -12,13 +12,13 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
|
-
python-version: [ "3.
|
|
15
|
+
python-version: [ "3.11", "3.12" ]
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
19
|
|
|
20
20
|
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
-
uses: actions/setup-python@
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
22
|
with:
|
|
23
23
|
python-version: ${{ matrix.python-version }}
|
|
24
24
|
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
20240929 - 0.5.0
|
|
5
|
+
----------------
|
|
6
|
+
|
|
7
|
+
- Chain errors to be more transparent to the error source (thanks @miaucl)
|
|
8
|
+
- Add KeyError exception (thanks @miaucl)
|
|
9
|
+
- Add line numbers (thanks @polgarc)
|
|
10
|
+
|
|
4
11
|
20231120 - 0.4.0
|
|
5
12
|
----------------
|
|
6
13
|
|
|
7
14
|
- Add support locations API (thanks @miaucl)
|
|
8
15
|
- Add missing connections parameters (thanks @miaucl)
|
|
9
16
|
- Add missing stationboard parameters (thanks @miaucl)
|
|
10
|
-
- Add "True" flag for correct formatting of lists (ex. via parameter `via[]=foo1&via[]=foo2`)
|
|
17
|
+
- Add "True" flag for correct formatting of lists (ex. via parameter `via[]=foo1&via[]=foo2`) (thanks @miaucl)
|
|
11
18
|
|
|
12
19
|
20211124 - 0.3.0
|
|
13
20
|
----------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-2024 Fabian Affolter <fabian@affolter-engineering.ch>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python_opendata_transport
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Python API for interacting with transport.opendata.ch.
|
|
5
5
|
Home-page: https://github.com/home-assistant-ecosystem/python-opendata-transport
|
|
6
6
|
Download-URL: https://github.com/home-assistant-ecosystem/python-opendata-transport/releases
|
|
@@ -14,12 +14,13 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
14
14
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
15
15
|
Classifier: Operating System :: Microsoft :: Windows
|
|
16
16
|
Classifier: Operating System :: POSIX
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
19
|
Classifier: Topic :: Utilities
|
|
21
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.11
|
|
22
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: aiohttp<4,>=3.8.5
|
|
23
|
+
Requires-Dist: urllib3
|
|
23
24
|
|
|
24
25
|
python-opendata-transport
|
|
25
26
|
=========================
|
{python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/opendata_transport/__init__.py
RENAMED
|
@@ -79,18 +79,18 @@ class OpendataTransportLocation(OpendataTransportBase):
|
|
|
79
79
|
_LOGGER.debug("Response from transport.opendata.ch: %s", response.status)
|
|
80
80
|
data = await response.json()
|
|
81
81
|
_LOGGER.debug(data)
|
|
82
|
-
except asyncio.TimeoutError:
|
|
82
|
+
except asyncio.TimeoutError as e:
|
|
83
83
|
_LOGGER.error("Can not load data from transport.opendata.ch")
|
|
84
|
-
raise exceptions.OpendataTransportConnectionError()
|
|
84
|
+
raise exceptions.OpendataTransportConnectionError() from e
|
|
85
85
|
except aiohttp.ClientError as aiohttpClientError:
|
|
86
86
|
_LOGGER.error("Response from transport.opendata.ch: %s", aiohttpClientError)
|
|
87
|
-
raise exceptions.OpendataTransportConnectionError()
|
|
87
|
+
raise exceptions.OpendataTransportConnectionError() from aiohttpClientError
|
|
88
88
|
|
|
89
89
|
try:
|
|
90
90
|
for station in data["stations"]:
|
|
91
91
|
self.locations.append(self.get_station(station))
|
|
92
|
-
except (TypeError, IndexError):
|
|
93
|
-
raise exceptions.OpendataTransportError()
|
|
92
|
+
except (KeyError, TypeError, IndexError) as e:
|
|
93
|
+
raise exceptions.OpendataTransportError() from e
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
class OpendataTransportStationboard(OpendataTransportBase):
|
|
@@ -164,18 +164,18 @@ class OpendataTransportStationboard(OpendataTransportBase):
|
|
|
164
164
|
_LOGGER.debug("Response from transport.opendata.ch: %s", response.status)
|
|
165
165
|
data = await response.json()
|
|
166
166
|
_LOGGER.debug(data)
|
|
167
|
-
except asyncio.TimeoutError:
|
|
167
|
+
except asyncio.TimeoutError as e:
|
|
168
168
|
_LOGGER.error("Can not load data from transport.opendata.ch")
|
|
169
|
-
raise exceptions.OpendataTransportConnectionError()
|
|
169
|
+
raise exceptions.OpendataTransportConnectionError() from e
|
|
170
170
|
except aiohttp.ClientError as aiohttpClientError:
|
|
171
171
|
_LOGGER.error("Response from transport.opendata.ch: %s", aiohttpClientError)
|
|
172
|
-
raise exceptions.OpendataTransportConnectionError()
|
|
172
|
+
raise exceptions.OpendataTransportConnectionError() from aiohttpClientError
|
|
173
173
|
|
|
174
174
|
try:
|
|
175
175
|
for journey in data["stationboard"]:
|
|
176
176
|
self.journeys.append(self.get_journey(journey))
|
|
177
|
-
except (TypeError, IndexError):
|
|
178
|
-
raise exceptions.OpendataTransportError()
|
|
177
|
+
except (KeyError, TypeError, IndexError) as e:
|
|
178
|
+
raise exceptions.OpendataTransportError() from e
|
|
179
179
|
|
|
180
180
|
async def async_get_data(self):
|
|
181
181
|
"""Retrieve the data for the given station."""
|
|
@@ -252,7 +252,11 @@ class OpendataTransport(OpendataTransportBase):
|
|
|
252
252
|
connection_info["number"] = ""
|
|
253
253
|
for section in connection["sections"]:
|
|
254
254
|
if section["journey"] is not None:
|
|
255
|
-
|
|
255
|
+
journey = section["journey"]
|
|
256
|
+
connection_info["number"] = journey["name"]
|
|
257
|
+
connection_info["line"] = "".join(
|
|
258
|
+
filter(None, [journey["category"], journey["number"]])
|
|
259
|
+
)
|
|
256
260
|
break
|
|
257
261
|
|
|
258
262
|
connection_info["platform"] = connection["from"]["platform"]
|
|
@@ -293,12 +297,12 @@ class OpendataTransport(OpendataTransportBase):
|
|
|
293
297
|
_LOGGER.debug("Response from transport.opendata.ch: %s", response.status)
|
|
294
298
|
data = await response.json()
|
|
295
299
|
_LOGGER.debug(data)
|
|
296
|
-
except asyncio.TimeoutError:
|
|
300
|
+
except asyncio.TimeoutError as e:
|
|
297
301
|
_LOGGER.error("Can not load data from transport.opendata.ch")
|
|
298
|
-
raise exceptions.OpendataTransportConnectionError()
|
|
302
|
+
raise exceptions.OpendataTransportConnectionError() from e
|
|
299
303
|
except aiohttp.ClientError as aiohttpClientError:
|
|
300
304
|
_LOGGER.error("Response from transport.opendata.ch: %s", aiohttpClientError)
|
|
301
|
-
raise exceptions.OpendataTransportConnectionError()
|
|
305
|
+
raise exceptions.OpendataTransportConnectionError() from aiohttpClientError
|
|
302
306
|
|
|
303
307
|
try:
|
|
304
308
|
self.from_id = data["from"]["id"]
|
|
@@ -309,5 +313,5 @@ class OpendataTransport(OpendataTransportBase):
|
|
|
309
313
|
for connection in data["connections"]:
|
|
310
314
|
self.connections[index] = self.get_connection(connection)
|
|
311
315
|
index = index + 1
|
|
312
|
-
except (TypeError, IndexError):
|
|
313
|
-
raise exceptions.OpendataTransportError()
|
|
316
|
+
except (KeyError, TypeError, IndexError) as e:
|
|
317
|
+
raise exceptions.OpendataTransportError() from e
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.
|
|
2
|
+
Name: python_opendata_transport
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Python API for interacting with transport.opendata.ch.
|
|
5
5
|
Home-page: https://github.com/home-assistant-ecosystem/python-opendata-transport
|
|
6
6
|
Download-URL: https://github.com/home-assistant-ecosystem/python-opendata-transport/releases
|
|
@@ -14,12 +14,13 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
14
14
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
15
15
|
Classifier: Operating System :: Microsoft :: Windows
|
|
16
16
|
Classifier: Operating System :: POSIX
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
19
|
Classifier: Topic :: Utilities
|
|
21
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.11
|
|
22
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: aiohttp<4,>=3.8.5
|
|
23
|
+
Requires-Dist: urllib3
|
|
23
24
|
|
|
24
25
|
python-opendata-transport
|
|
25
26
|
=========================
|
|
@@ -12,7 +12,7 @@ with open(os.path.join(here, "README.rst"), encoding="utf-8") as readme:
|
|
|
12
12
|
|
|
13
13
|
setup(
|
|
14
14
|
name="python_opendata_transport",
|
|
15
|
-
version="0.
|
|
15
|
+
version="0.5.0",
|
|
16
16
|
description="Python API for interacting with transport.opendata.ch.",
|
|
17
17
|
long_description=long_description,
|
|
18
18
|
url="https://github.com/home-assistant-ecosystem/python-opendata-transport",
|
|
@@ -21,11 +21,11 @@ setup(
|
|
|
21
21
|
author_email="fabian@affolter-engineering.ch",
|
|
22
22
|
license="MIT",
|
|
23
23
|
install_requires=[
|
|
24
|
-
"aiohttp>=3.8.
|
|
24
|
+
"aiohttp>=3.8.5,<4",
|
|
25
25
|
"urllib3",
|
|
26
26
|
],
|
|
27
27
|
packages=find_packages(),
|
|
28
|
-
python_requires=">=3.
|
|
28
|
+
python_requires=">=3.11",
|
|
29
29
|
zip_safe=True,
|
|
30
30
|
classifiers=[
|
|
31
31
|
"Development Status :: 3 - Alpha",
|
|
@@ -35,9 +35,8 @@ setup(
|
|
|
35
35
|
"Operating System :: MacOS :: MacOS X",
|
|
36
36
|
"Operating System :: Microsoft :: Windows",
|
|
37
37
|
"Operating System :: POSIX",
|
|
38
|
-
"Programming Language :: Python :: 3.9",
|
|
39
|
-
"Programming Language :: Python :: 3.10",
|
|
40
38
|
"Programming Language :: Python :: 3.11",
|
|
39
|
+
"Programming Language :: Python :: 3.12",
|
|
41
40
|
"Topic :: Utilities",
|
|
42
41
|
],
|
|
43
42
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_opendata_transport-0.4.0 → python_opendata_transport-0.5.0}/opendata_transport/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|