Skip to content

Commit

Permalink
Improve structure of project (DiviaVélodi) + bump version n° to 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
filau committed Sep 18, 2023
1 parent 771a58a commit 33ca3de
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ».

Expand Down
7 changes: 4 additions & 3 deletions divia_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
7 changes: 4 additions & 3 deletions divia_api/api.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

# coding=utf-8

"""
api.py
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
Expand All @@ -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
Expand All @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion divia_api/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion divia_api/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion divia_api/normalize_characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion divia_api/stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions divia_api/velodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = []
Expand Down
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,16 +31,16 @@
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,
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/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'
],
Expand All @@ -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'
]
)

0 comments on commit 33ca3de

Please sign in to comment.