python-opendata-transport 0.0.3__tar.gz → 0.1.1__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.0.3 → python_opendata_transport-0.1.1}/PKG-INFO +3 -2
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/README.rst +8 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/opendata_transport/__init__.py +4 -5
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/opendata_transport/exceptions.py +1 -1
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/python_opendata_transport.egg-info/PKG-INFO +3 -2
- python_opendata_transport-0.1.1/python_opendata_transport.egg-info/requires.txt +2 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/setup.py +8 -3
- python_opendata_transport-0.0.3/python_opendata_transport.egg-info/requires.txt +0 -1
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/LICENSE +0 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/MANIFEST.in +0 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/python_opendata_transport.egg-info/SOURCES.txt +0 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/python_opendata_transport.egg-info/dependency_links.txt +0 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/python_opendata_transport.egg-info/top_level.txt +0 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/python_opendata_transport.egg-info/zip-safe +0 -0
- {python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: python_opendata_transport
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Python API for interacting with transport.opendata.ch.
|
|
5
5
|
Home-page: https://github.com/fabaff/python-opendata-transport
|
|
6
6
|
Author: Fabian Affolter
|
|
@@ -16,5 +16,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
16
16
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
17
17
|
Classifier: Operating System :: Microsoft :: Windows
|
|
18
18
|
Classifier: Operating System :: POSIX
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.5
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
20
21
|
Classifier: Topic :: Utilities
|
|
@@ -3,8 +3,14 @@ python-opendata-transport
|
|
|
3
3
|
|
|
4
4
|
Python API for interacting with `transport.opendata.ch <http://transport.opendata.ch/>`_.
|
|
5
5
|
|
|
6
|
+
Th module which is the base for the integration into `Home Assistant <https://home-assistant.io>`_
|
|
7
|
+
is simply retrieving the details about a given connection between to stations.
|
|
8
|
+
|
|
9
|
+
This module is not official, developed, supported or endorsed by opendata.ch.
|
|
10
|
+
|
|
6
11
|
Installation
|
|
7
12
|
------------
|
|
13
|
+
|
|
8
14
|
The module is available from the `Python Package Index <https://pypi.python.org/pypi>`_.
|
|
9
15
|
|
|
10
16
|
.. code:: bash
|
|
@@ -18,6 +24,7 @@ The file ``example.py`` contains an example about how to use this module.
|
|
|
18
24
|
|
|
19
25
|
Development
|
|
20
26
|
-----------
|
|
27
|
+
|
|
21
28
|
For development is recommended to use a ``venv``.
|
|
22
29
|
|
|
23
30
|
.. code:: bash
|
|
@@ -28,4 +35,5 @@ For development is recommended to use a ``venv``.
|
|
|
28
35
|
|
|
29
36
|
License
|
|
30
37
|
-------
|
|
38
|
+
|
|
31
39
|
``python-opendata-transport`` is licensed under MIT, for more details check LICENSE.
|
{python_opendata_transport-0.0.3 → python_opendata_transport-0.1.1}/opendata_transport/__init__.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright (c) 2015-
|
|
2
|
+
Copyright (c) 2015-2018 Fabian Affolter <fabian@affolter-engineering.ch>
|
|
3
3
|
|
|
4
4
|
Licensed under MIT. All rights reserved.
|
|
5
5
|
"""
|
|
@@ -27,18 +27,17 @@ class OpendataTransport(object):
|
|
|
27
27
|
self.from_name = self.from_id = self.to_name = self.to_id = None
|
|
28
28
|
self.connections = dict()
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
def async_get_data(self):
|
|
30
|
+
async def async_get_data(self):
|
|
32
31
|
url = '{resource}connections?from={start}&to={dest}'.format(
|
|
33
32
|
resource=_RESOURCE, start=self.start, dest=self.destination)
|
|
34
33
|
|
|
35
34
|
try:
|
|
36
35
|
with async_timeout.timeout(5, loop=self._loop):
|
|
37
|
-
response =
|
|
36
|
+
response = await self._session.get(url)
|
|
38
37
|
|
|
39
38
|
_LOGGER.debug(
|
|
40
39
|
"Response from transport.opendata.ch: %s", response.status)
|
|
41
|
-
data =
|
|
40
|
+
data = await response.json()
|
|
42
41
|
_LOGGER.debug(data)
|
|
43
42
|
except (asyncio.TimeoutError, aiohttp.ClientError):
|
|
44
43
|
_LOGGER.error("Can not load data from transport.opendata.ch")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: python-opendata-transport
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Python API for interacting with transport.opendata.ch.
|
|
5
5
|
Home-page: https://github.com/fabaff/python-opendata-transport
|
|
6
6
|
Author: Fabian Affolter
|
|
@@ -16,5 +16,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
16
16
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
17
17
|
Classifier: Operating System :: Microsoft :: Windows
|
|
18
18
|
Classifier: Operating System :: POSIX
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.5
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
20
21
|
Classifier: Topic :: Utilities
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Copyright (c) 2015-2018 Fabian Affolter <fabian@affolter-engineering.ch>
|
|
2
4
|
|
|
5
|
+
Licensed under MIT. All rights reserved.
|
|
6
|
+
"""
|
|
3
7
|
import os
|
|
4
8
|
import sys
|
|
5
9
|
|
|
@@ -14,14 +18,14 @@ if sys.argv[-1] == 'publish':
|
|
|
14
18
|
|
|
15
19
|
setup(
|
|
16
20
|
name='python_opendata_transport',
|
|
17
|
-
version='0.
|
|
21
|
+
version='0.1.1',
|
|
18
22
|
description='Python API for interacting with transport.opendata.ch.',
|
|
19
23
|
url='https://github.com/fabaff/python-opendata-transport',
|
|
20
24
|
download_url='https://github.com/fabaff/python-opendata-transport/releases',
|
|
21
25
|
author='Fabian Affolter',
|
|
22
26
|
author_email='fabian@affolter-engineering.ch',
|
|
23
27
|
license='MIT',
|
|
24
|
-
install_requires=['aiohttp'],
|
|
28
|
+
install_requires=['aiohttp', 'async_timeout'],
|
|
25
29
|
packages=['opendata_transport'],
|
|
26
30
|
zip_safe=True,
|
|
27
31
|
classifiers=[
|
|
@@ -32,7 +36,8 @@ setup(
|
|
|
32
36
|
'Operating System :: MacOS :: MacOS X',
|
|
33
37
|
'Operating System :: Microsoft :: Windows',
|
|
34
38
|
'Operating System :: POSIX',
|
|
35
|
-
'Programming Language :: Python :: 3.
|
|
39
|
+
'Programming Language :: Python :: 3.5',
|
|
40
|
+
'Programming Language :: Python :: 3.6',
|
|
36
41
|
'Topic :: Utilities',
|
|
37
42
|
],
|
|
38
43
|
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
aiohttp
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|