From f9a1528f07663c3f9c84f674a6899c0298494078 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Sun, 1 Nov 2020 21:31:26 +0000 Subject: [PATCH] :hammer: Convert to snake case --- garagesamsterdam/__init__.py | 22 +++++++++++----------- setup.py | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/garagesamsterdam/__init__.py b/garagesamsterdam/__init__.py index baaa0b9..0849043 100644 --- a/garagesamsterdam/__init__.py +++ b/garagesamsterdam/__init__.py @@ -11,12 +11,12 @@ class AmsterdamCase: NAME = "Garages Amsterdam" id: str - garageName: str + garage_name: str state: str - freeSpaceShort: int - freeSpaceLong: int - shortCapacity: int - longCapacity: int + free_space_short: int + free_space_long: int + short_capacity: int + long_capacity: int @staticmethod def from_json(item): @@ -24,17 +24,17 @@ def from_json(item): id = item return AmsterdamCase( id=id["Id"], - garageName=correctName(attrs["Name"]), + garage_name=correct_name(attrs["Name"]), state=attrs["State"], - freeSpaceShort=attrs["FreeSpaceShort"], - freeSpaceLong=attrs["FreeSpaceLong"], - shortCapacity=attrs["ShortCapacity"], - longCapacity=attrs["LongCapacity"], + free_space_short=attrs["FreeSpaceShort"], + free_space_long=attrs["FreeSpaceLong"], + short_capacity=attrs["ShortCapacity"], + long_capacity=attrs["LongCapacity"], ) DEFAULT_SOURCE = AmsterdamCase -def correctName(name): +def correct_name(name): """Change parking garage name for consistency if needed.""" filter = ["CE-","ZD-","ZO-","ZU-"] corrections = ["P1 ", "P3 "] diff --git a/setup.py b/setup.py index fdaf540..89cb140 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,6 @@ def read(*parts): name="garagesamsterdam", packages=find_packages(include=["garagesamsterdam"]), url="https://github.com/klaasnicolaas/garagesamsterdam", - version="1.0.1", + version="1.0.2", zip_safe=False, ) \ No newline at end of file