stratified_packager.processing.report

CSV reporting: the run-level report and the per-zip reports (SPEC §9).

CSV is data, not UI: UTF-8 without BOM, header row, untranslated column names and status tokens (SPEC §20). This module needs no qgis import — rows arrive as plain data from the algorithm thread.

Module Attributes

UNMATCHED_KEY

Pseudo-stratum of the orphan-accounting rows (SPEC §9.1).

Functions

write_zip_report(path, rows, /)

Write one per-zip report.csv (SPEC §9.2).

Classes

RunReportRow(stratum, layer[, ...])

One row of the run-level report (SPEC §9.1).

ZipReportRow(stratum, layer_name[, ...])

One row of a per-zip report.csv (SPEC §9.2).

class stratified_packager.processing.report.RunReportRow(stratum, layer, feature_count=None, status='ok', detail='')[source]

One row of the run-level report (SPEC §9.1).

Parameters:
__init__(stratum, layer, feature_count=None, status='ok', detail='')
Parameters:
detail: str = ''

Error text or note.

feature_count: int | None = None

Features exported (empty cell when unknown/not applicable).

layer: str

Layer name.

status: str = 'ok'

One of the §9.1 status tokens.

stratum: str

Stratum name (or <unmatched> / <full>).

class stratified_packager.processing.report.ZipReportRow(stratum, layer_name, gpkg_table='', path_in_zip='', layer_type='', geometry_type='', feature_count=None, field_count=None, excluded_fields='', matching_method='', match_detail='', source_crs='', status='ok', detail='')[source]

One row of a per-zip report.csv (SPEC §9.2).

Parameters:
  • stratum (str)

  • layer_name (str)

  • gpkg_table (str)

  • path_in_zip (str)

  • layer_type (str)

  • geometry_type (str)

  • feature_count (int | None)

  • field_count (int | None)

  • excluded_fields (str)

  • matching_method (str)

  • match_detail (str)

  • source_crs (str)

  • status (str)

  • detail (str)

__init__(stratum, layer_name, gpkg_table='', path_in_zip='', layer_type='', geometry_type='', feature_count=None, field_count=None, excluded_fields='', matching_method='', match_detail='', source_crs='', status='ok', detail='')
Parameters:
  • stratum (str)

  • layer_name (str)

  • gpkg_table (str)

  • path_in_zip (str)

  • layer_type (str)

  • geometry_type (str)

  • feature_count (int | None)

  • field_count (int | None)

  • excluded_fields (str)

  • matching_method (str)

  • match_detail (str)

  • source_crs (str)

  • status (str)

  • detail (str)

detail: str = ''

Error text or note.

excluded_fields: str = ''

Semicolon-joined excluded field names.

feature_count: int | None = None

Features exported into this stratum’s table (empty for non-vector).

field_count: int | None = None

Exported fields after exclusions (empty for non-vector).

geometry_type: str = ''

Geometry type (vector layers only).

gpkg_table: str = ''

Table inside the member gpkg (empty for layers without one).

layer_name: str

Layer name.

layer_type: str = ''

vector | raster | mesh | point-cloud.

match_detail: str = ''

Relation-path ids or the spatial predicate used.

matching_method: str = ''

attribute | spatial | whole_export (as resolved).

path_in_zip: str = ''

<gpkg path>.gpkg, a data/... payload path, or empty.

source_crs: str = ''

Source CRS authid.

status: str = 'ok'

One of the §9.1 status tokens.

stratum: str

Member stratum name.

stratified_packager.processing.report._write(path, header, rows)[source]

Write one CSV (UTF-8, no BOM, header row).

Parameters:
Return type:

Path

Returns:

path.

stratified_packager.processing.report.write_zip_report(path, rows, /)[source]

Write one per-zip report.csv (SPEC §9.2).

Parameters:
  • path (Path) – Destination CSV path (staged into the zip’s build area).

  • rows (Iterable[ZipReportRow]) – One row per (member stratum x included layer).

Return type:

Path

Returns:

path.

stratified_packager.processing.report.UNMATCHED_KEY: Final = '<unmatched>'

Pseudo-stratum of the orphan-accounting rows (SPEC §9.1).