cadrumo.adapters.outbound.google._calc_sheets_apply_formatting module¶
Pure Google Sheets presentation and validation request builders.
The live apply adapter coordinates Drive and Sheets calls. This sibling owns
the pure request bodies that render a SheetExportPlan’s declared
formatting, grid, protection, and input-validation facets.
- build_number_format_requests(plan, *, sheet_id_by_tab)[source]¶
Apply each numeric casilla’s display format.
Money/integer cells render as NUMBER with the casilla’s pattern; ratio cells as PERCENT, matching the official AEAT workbook presentation.
- Return type:
list[Request]
- Parameters:
plan (SheetExportPlan)
- build_emphasis_format_requests(plan, *, sheet_id_by_tab)[source]¶
Bold the section-header cells and start/final anchor labels.
Applies the plan’s section-header and anchor styling. The label text is written by the value batch; this only sets the bold weight.
- Return type:
list[Request]
- Parameters:
plan (SheetExportPlan)
- build_base_font_requests(plan, *, sheet_id_by_tab)[source]¶
Set the monospace family across every tab’s whole grid in one request each.
The role-specific styled-range requests (which carry bold / colour / fill) run after these and merge on top, so the workbook reads in the chosen monospace family while the per-role emphasis still lands.
- Return type:
list[Request]
- Parameters:
plan (SheetExportPlan)
- build_styled_range_requests(plan, *, sheet_id_by_tab)[source]¶
Render each role-tagged styled range as a
repeatCellformat request.Resolves the range’s
StyleRolethrough the sharedROLE_STYLESpalette, so the slate header band, blue-grey section banners, pale-yellow input boxes, grey computed cells, green result, and wrapped body columns render consistently. Later ranges win on overlap (the API applies requests in order), matching the engine’s accent-last ordering.- Return type:
list[Request]
- Parameters:
plan (SheetExportPlan)
- build_column_width_requests(column_widths, *, sheet_id_by_tab)[source]¶
Size each declared column so labels and legal-ref columns do not clip.
- Return type:
list[Request]
- Parameters:
column_widths (Iterable[SheetColumnWidth])
- build_frozen_view_requests(frozen_views, *, sheet_id_by_tab)[source]¶
Freeze the header rows / leading columns so they stay visible on scroll.
- Return type:
list[Request]
- Parameters:
frozen_views (Iterable[SheetFrozenView])
- build_auto_filter_requests(auto_filters, *, sheet_id_by_tab)[source]¶
Install a basic filter over each tab’s header + data rows.
- Return type:
list[Request]
- Parameters:
auto_filters (Iterable[SheetAutoFilter])
- build_grid_resize_requests(plan, *, sheet_id_by_tab)[source]¶
Compute requests to grow tabs beyond the default Sheets grid.
Resizes always grow; an operator-expanded grid is never shrunk.
- Return type:
list[Request]
- Parameters:
plan (SheetExportPlan)
- build_protected_range_requests(protected, *, sheet_id_by_tab)[source]¶
Build immutable-sheet protection requests for the plan’s declared ranges.
- Return type:
list[Request]
- Parameters:
protected (Iterable[SheetProtectedRange])
- build_cell_constraint_requests(constraints, *, sheet_id_by_tab)[source]¶
Translate each constrained cell into validation and grounding-note requests.
- Return type:
list[Request]
- Parameters:
constraints (Iterable[SheetCellConstraint])