pycsamt.seg.sections#

Functions

iter_sections(edi_path, *[, include])

Yield (tag, header_obj, body_start_line) for each '>=...' block.

pycsamt.seg.sections.iter_sections(edi_path, *, include=None)[source]#

Yield (tag, header_obj, body_start_line) for each ‘>=…’ block.

Parameters:
  • edi_path (str) – Path to EDI file.

  • include (list of str, optional) – If given, only yield tags in this list (case-insens.). Tags must match keys in SECT_REGISTRY.

Yields:

(tag, header, body_start) (tuple) – tag : str, e.g. “>=MTSECT” header : parsed header instance body_start : int, index of first line after header,

i.e., where the first ‘>BLOCK’ (or next section) begins.

Return type:

Iterator[tuple[str, EDIComponentBase, int]]