# ----------------------------------------------------------------------------- # Lou-Ka — Agrégateur de logements à louer (province de Québec) # Auteur : Simon-Pierre Boucher — contact@spboucher.ai # connectors/vallem.py : connecteur Vallem (vallem.ca — condos locatifs + # marché d'alimentation au 4605, chemin du Crépuscule, quartier Lumicité, # Saint-Mathieu-de-Beloeil, à l'entrée de la vallée du Richelieu). # Le site statique n'affiche aucun prix : la page /plans est un simple # iframe Planpoint (app.planpoint.io/otium/vallem) — on interroge l'API # JSON publique via le helper _planpoint.py. Granularité = UNITÉ (prix, # pi², chambres, étage, plans). Le projet Planpoint ne publie pas # d'adresse -> adresse civique fixée ici (Google Maps du site officiel). # ----------------------------------------------------------------------------- from __future__ import annotations from ..schema import Listing from ._planpoint import planpoint_projects, unit_listing from .base import BaseConnector PAGE_URL = "https://vallem.ca/plans/" NAMESPACE = "otium" HOST_NAME = "vallem" ADDRESS = "4605, chemin du Crépuscule" CITY = "Saint-Mathieu-de-Beloeil" class VallemConnector(BaseConnector): source_id = "vallem" request_delay = 0.8 def fetch(self) -> list[Listing]: try: projects = planpoint_projects(self, "projects", NAMESPACE, HOST_NAME) except Exception: return [] listings: list[Listing] = [] for project in projects: for floor in project.get("floors") or []: for unit in floor.get("units") or []: lst = unit_listing(self.source_id, project, floor, unit, page_url=PAGE_URL, default_city=CITY) if lst is None: continue if not lst.address: # projet Planpoint sans adresse lst.address = ADDRESS listings.append(lst) return listings