SPB Git

Repository Public

marquise_8.py 6.0 KB 149 lines python

1# =============================================================================2#                  SP BOUCHER | SOFTWARE & RESEARCH3#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4# =============================================================================5#6# PROJECT METADATA7# -----------------------------------------------------------------------------8# Project          : Lou·Ka9# File             : louka/connectors/marquise_8.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/marquise_8.py : connecteur Marquise 8 (marquise8.com — Devmet/91#   Marquise Condominiums). Tour de 137 condos locatifs tout inclus au92#   3641, avenue Jean-Béraud à Laval (Chomedey, centre-ville). Le site93#   Webflow affiche ses unités via le widget Planpoint : on interroge l'API94#   JSON publique (app.planpoint.io/api/projects/find, 1 requête/sync,95#   voir _planpoint.py). Granularité UNITÉ (numéro de porte, pi², plan,96#   étage) mais AUCUN prix publié (« unitPriceTBD ») ni typologie ; seules97#   les unités « Available » sont retenues. deliveryDate au format98#   JJ-MM-AAAA (contrairement aux autres comptes Planpoint) — converti ici.99# -----------------------------------------------------------------------------100from __future__ import annotations101102import re103104from ..schema import Listing105from ._planpoint import planpoint_projects, unit_listing106from .base import BaseConnector107108PAGE_URL = "https://marquise8.com/#unite"109NAMESPACE = "marquise-8"110HOST_NAME = "marquise-8"111112DEFAULT_CITY = "Laval"113SECTOR = "Chomedey"114115EXTRA_AMENITIES = ["Formule tout inclus"]116117# « 01-07-2026 » (JJ-MM-AAAA, spécifique à ce compte) -> ISO « 2026-07-01 »118_DMY_RE = re.compile(r"^(\d{2})-(\d{2})-(\d{4})$")119120121class Marquise8Connector(BaseConnector):122    source_id = "marquise_8"123    request_delay = 0.8124125    def fetch(self) -> list[Listing]:126        try:127            projects = planpoint_projects(self, "projects", NAMESPACE, HOST_NAME)128        except Exception:129            return []130        listings: list[Listing] = []131        for project in projects:132            for floor in project.get("floors") or []:133                for unit in floor.get("units") or []:134                    lst = unit_listing(self.source_id, project, floor, unit,135                                       page_url=PAGE_URL,136                                       default_city=DEFAULT_CITY,137                                       extra_amenities=EXTRA_AMENITIES)138                    if lst is None:139                        continue140                    lst.sector = SECTOR141                    # date de livraison JJ-MM-AAAA -> ISO142                    m = _DMY_RE.match(lst.availability_date or "")143                    if m:144                        iso = f"{m.group(3)}-{m.group(2)}-{m.group(1)}"145                        lst.availability_date = iso146                        lst.availability = f"Disponible le {iso}"147                    listings.append(lst)148        return listings149
Files main
Menu

Theme