Skip to content

Commit

Permalink
🔨 Convert to snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Nov 1, 2020
1 parent 8dc94dc commit f9a1528
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions garagesamsterdam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ 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):
attrs = item["properties"]
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 "]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit f9a1528

Please sign in to comment.