diff --git a/divia_api/__init__.py b/divia_api/__init__.py index 7060369..569d1a5 100644 --- a/divia_api/__init__.py +++ b/divia_api/__init__.py @@ -25,6 +25,6 @@ __author__ = 'Firmin Launay' __license__ = 'LGPL-3.0' __copyright__ = 'divia_api Copyright (C) 2021 Firmin Launay' -__version__ = '1.2' +__version__ = '1.3' from .api import DiviaAPI diff --git a/divia_api/line.py b/divia_api/line.py index e757852..627d19b 100644 --- a/divia_api/line.py +++ b/divia_api/line.py @@ -22,6 +22,7 @@ """ from .stop import Stop +from unidecode import unidecode class Line: @@ -43,7 +44,7 @@ def find_stop(self, stop_name: str) -> Stop: if len(corresponding_stops) > 0: return Stop(self.api_data, self, corresponding_stops[0]) corresponding_stops = list(item for item in self.line_data["arrets"].values() - if item["nom"].replace(" " + self.line_data["codetotem"], "").lower() == - stop_name.lower().replace(" " + self.line_data["codetotem"].lower(), "")) + if unidecode(item["nom"].replace(" " + self.line_data["codetotem"], "").lower()) == + unidecode(stop_name.lower().replace(" " + self.line_data["codetotem"].lower(), ""))) if len(corresponding_stops) > 0: return Stop(self.api_data, self, corresponding_stops[0]) diff --git a/requirements.txt b/requirements.txt index f229360..416644d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ requests +unidecode diff --git a/setup.py b/setup.py index a8b800b..bdfb361 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setup( name='divia_api', packages=['divia_api'], - version='1.2', + version='1.3', license='LGPL-3.0', description='divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script.', long_description=long_description, @@ -39,10 +39,11 @@ author='Firmin Launay', author_email='hey@firminlaunay.me', url='https://github.com/filau/python_divia_api', - download_url='https://github.com/filau/python_divia_api/archive/refs/tags/1.2.tar.gz', + download_url='https://github.com/filau/python_divia_api/archive/refs/tags/1.3.tar.gz', keywords=['divia', 'api', 'firmin', 'launay', 'dijon', 'bus', 'tram'], install_requires=[ - 'requests' + 'requests', + 'unidecode' ], classifiers=[ 'Development Status :: 5 - Production/Stable',