python-opendata-transport 0.0.2__tar.gz → 0.1.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.0.2 → python_opendata_transport-0.1.0}/PKG-INFO +3 -2
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/README.rst +3 -10
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/opendata_transport/__init__.py +4 -5
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/opendata_transport/exceptions.py +2 -2
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/python_opendata_transport.egg-info/PKG-INFO +3 -2
- python_opendata_transport-0.1.0/python_opendata_transport.egg-info/requires.txt +2 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/setup.py +8 -3
- python_opendata_transport-0.0.2/python_opendata_transport.egg-info/requires.txt +0 -1
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/LICENSE +0 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/MANIFEST.in +0 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/python_opendata_transport.egg-info/SOURCES.txt +0 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/python_opendata_transport.egg-info/dependency_links.txt +0 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/python_opendata_transport.egg-info/top_level.txt +0 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/python_opendata_transport.egg-info/zip-safe +0 -0
- {python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: python_opendata_transport
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
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
|
|
@@ -14,22 +14,15 @@ The module is available from the `Python Package Index <https://pypi.python.org/
|
|
|
14
14
|
Usage
|
|
15
15
|
-----
|
|
16
16
|
|
|
17
|
-
The file ``example.py`` contains
|
|
18
|
-
|
|
19
|
-
.. code:: bash
|
|
20
|
-
|
|
21
|
-
>>> from opendata_transport import OpendataTransport
|
|
22
|
-
>>> data = OpendataTransport('Bern', 'Biel')
|
|
23
|
-
>>> data.get_data()
|
|
24
|
-
>>> print(data.connections)
|
|
17
|
+
The file ``example.py`` contains an example about how to use this module.
|
|
25
18
|
|
|
26
19
|
Development
|
|
27
20
|
-----------
|
|
28
|
-
For development is
|
|
21
|
+
For development is recommended to use a ``venv``.
|
|
29
22
|
|
|
30
23
|
.. code:: bash
|
|
31
24
|
|
|
32
|
-
$ python3.6 -m venv
|
|
25
|
+
$ python3.6 -m venv .
|
|
33
26
|
$ source bin/activate
|
|
34
27
|
$ python3 setup.py develop
|
|
35
28
|
|
{python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/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")
|
{python_opendata_transport-0.0.2 → python_opendata_transport-0.1.0}/opendata_transport/exceptions.py
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
"""
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class OpendataTransportError(Exception):
|
|
9
|
-
"""General
|
|
9
|
+
"""General OpenDataError exception occurred."""
|
|
10
10
|
|
|
11
11
|
pass
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: python-opendata-transport
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
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.0
|
|
21
|
+
version='0.1.0',
|
|
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
|