Skip to content

Commit

Permalink
simplified the scraper further
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed May 5, 2024
1 parent caecd36 commit f1f81e7
Show file tree
Hide file tree
Showing 5 changed files with 111,262 additions and 39,029 deletions.
11 changes: 7 additions & 4 deletions data/external/models/tumonline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Address(PydanticConfiguration):
floor: str
place: str
street: str
zip_code: int
Expand All @@ -18,11 +17,14 @@ class Seats(PydanticConfiguration):

# pylint: disable-next=too-many-instance-attributes
class Room(PydanticConfiguration):
alt_name: str
address: Address
seats: Seats
floor_type: str
floor_level: str
tumonline_id: int
area_id: int
building_id: int
floor_type: str
main_operator_id: int
usage_id: int
arch_name: str | None = None
Expand All @@ -37,15 +39,16 @@ def load_all(cls) -> dict[str, "Room"]:


class Building(PydanticConfiguration):
address: Address
area_id: int
filter_id: int
name: str

@classmethod
def load_all(cls) -> list["Building"]:
def load_all(cls) -> dict[str, "Building"]:
"""Load all tumonline.Building's"""
with open(RESULTS / "buildings_tumonline.json", encoding="utf-8") as file:
return [cls.model_validate(item) for item in json.load(file)]
return {key: cls.model_validate(item) for key, item in json.load(file).items()}


class Organisation(PydanticConfiguration):
Expand Down
4 changes: 2 additions & 2 deletions data/external/results/buildings_roomfinder.json
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@
"b_alias": "",
"b_area": "M\u00fcnchen - Stammgel\u00e4nde Zentral",
"b_id": "0502",
"b_name": "Zentralgeb\u00e4ude 2",
"b_name": "Bestelmeyer S\u00fcd",
"b_room_count": 359,
"default_map": [
"4000",
Expand Down Expand Up @@ -1233,7 +1233,7 @@
"b_alias": "",
"b_area": "M\u00fcnchen - Stammgel\u00e4nde Zentral",
"b_id": "0507",
"b_name": "Zentralgeb\u00e4ude 7",
"b_name": "Bestelmeyer Nord",
"b_room_count": 342,
"default_map": [
"4000",
Expand Down
Loading

0 comments on commit f1f81e7

Please sign in to comment.