Skip to content

Commit 3df3ca9

Browse files
committed
Normalize accents + bump version n° to 1.3
1 parent 22e5e23 commit 3df3ca9

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

divia_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
__author__ = 'Firmin Launay'
2626
__license__ = 'LGPL-3.0'
2727
__copyright__ = 'divia_api Copyright (C) 2021 Firmin Launay'
28-
__version__ = '1.2'
28+
__version__ = '1.3'
2929

3030
from .api import DiviaAPI

divia_api/line.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"""
2323

2424
from .stop import Stop
25+
from unidecode import unidecode
2526

2627

2728
class Line:
@@ -43,7 +44,7 @@ def find_stop(self, stop_name: str) -> Stop:
4344
if len(corresponding_stops) > 0:
4445
return Stop(self.api_data, self, corresponding_stops[0])
4546
corresponding_stops = list(item for item in self.line_data["arrets"].values()
46-
if item["nom"].replace(" " + self.line_data["codetotem"], "").lower() ==
47-
stop_name.lower().replace(" " + self.line_data["codetotem"].lower(), ""))
47+
if unidecode(item["nom"].replace(" " + self.line_data["codetotem"], "").lower()) ==
48+
unidecode(stop_name.lower().replace(" " + self.line_data["codetotem"].lower(), "")))
4849
if len(corresponding_stops) > 0:
4950
return Stop(self.api_data, self, corresponding_stops[0])

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
requests
2+
unidecode

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@
3131
setup(
3232
name='divia_api',
3333
packages=['divia_api'],
34-
version='1.2',
34+
version='1.3',
3535
license='LGPL-3.0',
3636
description='divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script.',
3737
long_description=long_description,
3838
long_description_content_type='text/markdown',
3939
author='Firmin Launay',
4040
author_email='hey@firminlaunay.me',
4141
url='https://github.com/filau/python_divia_api',
42-
download_url='https://github.com/filau/python_divia_api/archive/refs/tags/1.2.tar.gz',
42+
download_url='https://github.com/filau/python_divia_api/archive/refs/tags/1.3.tar.gz',
4343
keywords=['divia', 'api', 'firmin', 'launay', 'dijon', 'bus', 'tram'],
4444
install_requires=[
45-
'requests'
45+
'requests',
46+
'unidecode'
4647
],
4748
classifiers=[
4849
'Development Status :: 5 - Production/Stable',

0 commit comments

Comments
 (0)