build_tools.syllable_walk_web.services.packager
Package builder service for the web application.
Bundles walk results, candidates, and selections from both patches
into a downloadable ZIP archive with a manifest. Also writes a
companion _metadata.json file to disk next to the ZIP for
provenance tracking (matching the TUI packager behaviour).
Functions
|
Build a ZIP archive from in-memory walker state. |
Module Contents
- build_tools.syllable_walk_web.services.packager.build_package(state, *, name='corpus-package', version='0.1.0', include_walks_a=True, include_walks_b=True, include_candidates=True, include_selections=True)[source]
Build a ZIP archive from in-memory walker state.
Also writes the ZIP and a companion metadata JSON file to disk under
<output_base>/packages/.- Parameters:
state (build_tools.syllable_walk_web.state.ServerState) – Global server state with patch data.
name (str) – Package name (used in the ZIP filename).
version (str) – Package version string.
include_walks_a (bool) – Include Patch A walks.
include_walks_b (bool) – Include Patch B walks.
include_candidates (bool) – Include candidates from both patches.
include_selections (bool) – Include selections from both patches.
- Returns:
Tuple of (zip_bytes, error_message_or_none).
- Return type: