Skip to content

Commit

Permalink
Normalize accents + bump version n° to 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
filau committed Jul 20, 2021
1 parent 22e5e23 commit 3df3ca9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion divia_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions divia_api/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"""

from .stop import Stop
from unidecode import unidecode


class Line:
Expand All @@ -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])
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requests
unidecode
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@
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,
long_description_content_type='text/markdown',
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',
Expand Down

0 comments on commit 3df3ca9

Please sign in to comment.