api.scripts.u3000_price_grid ============================ .. py:module:: api.scripts.u3000_price_grid .. autoapi-nested-parse:: UltiMate 3000 buy-back price grid, scraped from the Google Sheet "Offre de reprise U3000 Rewake". Triggered by the sheet itself (Apps Script onChange -> POST /webhooks/u3000-price-grid, debounced) or on demand from app.rewake.fr. The accepted grid is this script's run snapshot, which api/services/ultimate3000/pricing.py reads; a sheet that doesn't parse is a failed run and the previous grid stays live. Sheet format (first sheet; only the first two grids, everything after is ignored): a header row with a "Module" cell and two price cells ("...fonctionnel", "...sinon"), then module rows, 5 zones separated by empty *filled* (gray) rows, in `pricing.CATEGORIES` order: the zone decides the category, the "Catégorie" column is ignored. The first empty unfilled (white) row ends the grid. Grid 1 = post 2013, grid 2 = pre 2013. Attributes ---------- .. autoapisummary:: api.scripts.u3000_price_grid.Cell api.scripts.u3000_price_grid.GRIDS api.scripts.u3000_price_grid.GRID_LABELS api.scripts.u3000_price_grid.SHEET_RANGE Classes ------- .. autoapisummary:: api.scripts.u3000_price_grid.U3000PriceGrid Functions --------- .. autoapisummary:: api.scripts.u3000_price_grid.parse api.scripts.u3000_price_grid.diff api.scripts.u3000_price_grid.fetch_rows Module Contents --------------- .. py:data:: Cell .. py:data:: GRIDS :value: ('post_2013', 'pre_2013') .. py:data:: GRID_LABELS .. py:data:: SHEET_RANGE :value: 'A1:J300' .. py:function:: parse(rows: list[list[Cell]]) -> tuple[dict[str, Any], list[str]] Returns ({grid: {category: {model: [price ok, price otherwise]}}}, errors). Rows are 1-based in the messages, as in the sheet. .. py:function:: diff(old: dict[str, Any], new: dict[str, Any]) -> list[str] Human-readable changes between two parsed grids. .. py:function:: fetch_rows() -> list[list[Cell]] .. py:class:: U3000PriceGrid .. py:attribute:: name :value: 'u3000_price_grid' .. py:attribute:: schedule :value: None .. py:method:: is_configured() -> bool .. py:method:: run(previous_snapshot: dict[str, Any] | None = None, report_stage: api.scripts.base.StageReporter = lambda stage: None, **kwargs: Any) -> tuple[api.scripts.base.ScriptResult, dict[str, Any] | None]