Repository Public
1# =============================================================================2# SP BOUCHER | SOFTWARE & RESEARCH3# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4# =============================================================================5#6# PROJECT METADATA7# -----------------------------------------------------------------------------8# Project : Lou·Ka9# File : louka/connectors/m3_laval.py10# Module : louka11# Repository : https://git.spboucher.ai/lou-ka12# Created : 2026-08-2513# Last Modified : 2026-08-2514#15# =============================================================================16# AUTHOR & PROFESSIONAL AFFILIATION17# =============================================================================18#19# Author : Simon-Pierre Boucher20# Position : Professor of Finance21# Institution : Université du Québec en Outaouais (UQO)22# Department : Département des sciences administratives23# Organization : SP Boucher24#25# Website : https://spboucher.ai26# Git : https://git.spboucher.ai27#28# =============================================================================29# OFFICIAL CONTACT DIRECTORY30# =============================================================================31#32# General : info@spboucher.ai33# Professional : contact@spboucher.ai34# Direct : simon@spboucher.ai35# Research : research@spboucher.ai36# Development : dev@spboucher.ai37# Support : support@spboucher.ai38# Security/Admin : admin@spboucher.ai39# Notifications : notifications@spboucher.ai40#41# Preferred Contact: contact@spboucher.ai42#43# =============================================================================44# COPYRIGHT & INTELLECTUAL PROPERTY45# =============================================================================46#47# Copyright (c) 202648# Simon-Pierre Boucher49#50# All rights reserved where applicable.51#52# This file is governed by the applicable project license,53# copyright notices, institutional agreements and relevant law.54#55# Unless expressly authorized by the applicable license or56# rights holder, copying, redistribution, sublicensing,57# publication and commercial exploitation are not permitted.58#59# Existing third-party rights and notices remain unaffected.60#61# =============================================================================62# CONFIDENTIALITY & SECURITY63# =============================================================================64#65# Classification : Public66# Distribution : Public repository; use is governed by the project license67# Security Contact : admin@spboucher.ai68#69# Access to this source does not independently grant permission70# to redistribute or disclose confidential materials.71#72# Do not embed credentials, private keys, access tokens,73# certificates or confidential personal information.74#75# =============================================================================76# LICENSE & MAINTENANCE77# =============================================================================78#79# License : None specified (no license file in this repository)80# Maintainer : Simon-Pierre Boucher81# Technical Contact: dev@spboucher.ai82#83# =============================================================================84# END OF SP BOUCHER SOURCE HEADER85# =============================================================================8687# -----------------------------------------------------------------------------88# Lou-Ka — Agrégateur de logements à louer (province de Québec)89# Auteur : Simon-Pierre Boucher — contact@spboucher.ai90# connectors/m3_laval.py : connecteur M3 Condos locatifs (m3mirabel.com —91# Cité Mirabel, boul. de Versailles ; 2 groupes d'immeubles : Bâtiments 1 à 392# et 4 à 7, ~325 unités). NB : slug historique « m3_laval » de la campagne93# Laval/Rive-Nord, mais le projet est bien à MIRABEL (Laurentides).94# La page /plans/ affiche ses unités via le widget Planpoint : on interroge95# l'API JSON publique (app.planpoint.io/api/projects/find, 2 requêtes/sync,96# voir _planpoint.py). Granularité UNITÉ : type (« 4 1/2 »), pi², chambres,97# plans par unité, adresse + lat/lng par immeuble ; la source ne publie98# AUCUN prix (price null/0 chez Planpoint, pas de prix sur le site non99# plus) — rien d'inventé. Seules les unités « Available » sont retenues.100# -----------------------------------------------------------------------------101from __future__ import annotations102103from ..schema import Listing104from ._planpoint import planpoint_projects, unit_listing105from .base import BaseConnector106107PAGE_URL = "https://www.m3mirabel.com/plans/"108NAMESPACE = "M3MIRABEL"109HOST_NAMES = ("Batiment1a3", "Batiments4a7")110111112class M3LavalConnector(BaseConnector):113 source_id = "m3_laval"114 request_delay = 0.8115116 def fetch(self) -> list[Listing]:117 listings: list[Listing] = []118 for host in HOST_NAMES:119 try:120 projects = planpoint_projects(self, "projects", NAMESPACE, host)121 except Exception:122 continue123 for project in projects:124 for floor in project.get("floors") or []:125 for unit in floor.get("units") or []:126 lst = unit_listing(self.source_id, project, floor, unit,127 page_url=PAGE_URL,128 default_city="Mirabel")129 if lst is not None:130 listings.append(lst)131 return listings132