From 33ca3de771429d524600b60621a31d8d730aee9f Mon Sep 17 00:00:00 2001 From: Firmin Launay Date: Mon, 18 Sep 2023 21:52:47 +0200 Subject: [PATCH] =?UTF-8?q?Improve=20structure=20of=20project=20(DiviaV?= =?UTF-8?q?=C3=A9lodi)=20+=20bump=20version=20n=C2=B0=20to=202.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- divia_api/__init__.py | 7 ++++--- divia_api/api.py | 7 ++++--- divia_api/exceptions.py | 2 +- divia_api/line.py | 2 +- divia_api/normalize_characters.py | 2 +- divia_api/stop.py | 2 +- divia_api/velodi.py | 4 ++-- setup.py | 12 +++++++----- 9 files changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 412b9db..cf27e7c 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ print(totem_result) # Affichage du résultat. ## Exemple de l’utilisation de l’API Vélodi ```python -from divia_api import DiviaAPI +from divia_api import VelodiAPI -velodi_api = DiviaAPI().velodi +velodi_api = VelodiAPI() station = velodi_api.find_station("Lycée Carnot") # Récupération de la station DiviaVélodi « Lycée Carnot ». diff --git a/divia_api/__init__.py b/divia_api/__init__.py index fc53dee..05f8a85 100644 --- a/divia_api/__init__.py +++ b/divia_api/__init__.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,8 @@ __title__ = 'divia_api' __author__ = 'Firmin Launay' __license__ = 'LGPL-3.0' -__copyright__ = 'divia_api Copyright (C) 2021 Firmin Launay' -__version__ = '2.3' +__copyright__ = 'divia_api Copyright (C) 2023 Firmin Launay' +__version__ = '2.4' from .api import DiviaAPI +from .velodi import VelodiAPI diff --git a/divia_api/api.py b/divia_api/api.py index 60250ce..b5d4ab2 100644 --- a/divia_api/api.py +++ b/divia_api/api.py @@ -1,3 +1,4 @@ + # coding=utf-8 """ @@ -5,7 +6,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +24,7 @@ from requests import get from json import loads -from .velodi import Velodi +from .velodi import VelodiAPI from .line import Line from .stop import Stop from .exceptions import InvalidWay @@ -38,7 +39,7 @@ def __init__(self): self.network = loads(raw_network) self.lines = self.network["lignes"].values() self.stops = self.network["arrets"].values() - self.velodi = Velodi() + self.velodi = VelodiAPI() # Deprecated, directly import and initialize VelodiAPI instead. def get_line(self, line_id: str) -> Line: """Find a line by specifying its unique identifier.""" diff --git a/divia_api/exceptions.py b/divia_api/exceptions.py index 46e5fe9..0a05e7d 100644 --- a/divia_api/exceptions.py +++ b/divia_api/exceptions.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/divia_api/line.py b/divia_api/line.py index 5a5a74e..14f6bc1 100644 --- a/divia_api/line.py +++ b/divia_api/line.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/divia_api/normalize_characters.py b/divia_api/normalize_characters.py index 0f017a2..ee79228 100644 --- a/divia_api/normalize_characters.py +++ b/divia_api/normalize_characters.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/divia_api/stop.py b/divia_api/stop.py index 0b8eea7..27c5d7a 100644 --- a/divia_api/stop.py +++ b/divia_api/stop.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/divia_api/velodi.py b/divia_api/velodi.py index 61455cd..c3a1872 100644 --- a/divia_api/velodi.py +++ b/divia_api/velodi.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,7 +73,7 @@ def check(self): raise Exception("Data not found.") -class Velodi: +class VelodiAPI: def __init__(self): self.data = update_source() self.stations = [] diff --git a/setup.py b/setup.py index 7067b00..bec193c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways straight from a Python script. -Copyright (C) 2021 Firmin Launay +Copyright (C) 2023 Firmin Launay This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ setup( name='divia_api', packages=['divia_api'], - version='2.3', + version='2.4', license='LGPL-3.0', description='divia_api is a Python library that allows to retrieve the timetable of Divia’s bus and tramways, along with some infos about DiviaVélodi bikes, straight from a Python script.', long_description=long_description, @@ -39,8 +39,8 @@ 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/2.3.tar.gz', - keywords=['divia', 'api', 'firmin', 'launay', 'dijon', 'bus', 'tram'], + download_url='https://github.com/filau/python_divia_api/archive/refs/tags/2.4.tar.gz', + keywords=['divia', 'api', 'firmin', 'launay', 'dijon', 'bus', 'tram', 'velodi'], install_requires=[ 'requests' ], @@ -52,6 +52,8 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9' + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11' ] )