core.generator.utils.hwpx_worship_order_parser

File:

EuljiroWorship/core/generator/utils/hwpx_worship_order_parser.py

Author:

Benjamin Jaedon Choi - https://github.com/saintbenjamin

Affiliated Church:

The Eulji-ro Presbyterian Church [대한예수교장로회(통합) 을지로교회]

Address:

The Eulji-ro Presbyterian Church, 24-10, Eulji-ro 20-gil, Jung-gu, Seoul 04549, South Korea

Telephone:

+82-2-2266-3070

E-mail:

euljirochurch [at] G.M.A.I.L. (replace [at] with @ and G.M.A.I.L as you understood.)

License:

MIT License with Attribution Requirement (see LICENSE file for details); Copyright (c) 2025 The Eulji-ro Presbyterian Church.

HWPX worship-order parser for the Slide Generator’s Euljiro-specific bulletin workflow.

This module parses HWPX section XML files, locates the portions of the weekly bulletin that contain the first-service worship order and the afternoon praise service order, and converts supported rows into normalized entry dictionaries for generator-side update logic.

The logic here is intentionally church-specific. It assumes Euljiro Presbyterian Church bulletin patterns such as:

  • A first-service order embedded in a known HWPX bulletin structure

  • An afternoon praise-service order embedded in the second-page middle column

  • Worship-order labels and line formats used by Euljiro weekly bulletins

  • Euljiro-specific expectations around choir naming, sermon-title handling, first-service extraction, praise-service extraction, and special liturgical insertions

These helpers exist to support the church-specific Tools-menu import features, not as a general-purpose HWPX worship-order parser for arbitrary churches.

core.generator.utils.hwpx_worship_order_parser.extract_first_service_order_entries_from_hwpx(hwpx_path)[source]

Extract recognized first-service worship-order entries from a HWPX bulletin.

Parameters:

hwpx_path (str) – Filesystem path to the source HWPX bulletin file.

Returns:

Ordered list of normalized worship-order entry dictionaries suitable for generator-side update logic.

Return type:

list[dict]

Raises:

ValueError – Raised when no supported first-service worship-order items can be extracted from the file.

core.generator.utils.hwpx_worship_order_parser.extract_praise_service_order_entries_from_hwpx(hwpx_path)[source]

Extract recognized afternoon praise-service order entries from a HWPX bulletin.

Parameters:

hwpx_path (str) – Filesystem path to the source HWPX bulletin file.

Returns:

Ordered list of normalized afternoon praise-service entry dictionaries suitable for generator-side update logic.

Return type:

list[dict]

Raises:

ValueError – Raised when no supported afternoon praise-service items can be extracted from the file.