officiumdivinum.parsers package¶
The parsers are one-off scripts used to turn divinumofficium source files (flat-file databases) into objects we can use. They should not be needed in the future, unless adding a flavour divinumofficium supports and we don’t, or building a radically different structure.
Note that if you just want to edit content, you should edit it directly in our format, not jig the parser. We make no effort to have our internal data generateable from divinumofficium sources: we just used them at the beginning.
Submodules¶
officiumdivinum.parsers.K2obj module¶
Parse Divinumofficium’s calendar tabulae into feast objects.
-
officiumdivinum.parsers.K2obj.parse_file(fn: pathlib.Path, calendar: str)[source]¶ Parse a divinumofficium calendar file.
- Parameters
fn (Path : The file to parse.)
calendar (str : The calendar to use to generate feast names, etc.)
- Returns
A list of Feast objects.
-
officiumdivinum.parsers.K2obj.parse_line(line: str, calendar: str) → officiumdivinum.objects.datastructures.Feast[source]¶ Parse a line of a divinumofficium calendar file.
- Parameters
line (str : The line to parse.)
calendar (str : The Calendar to use (for feast names, etc.))
- Returns
A Feast object representing the day.
officiumdivinum.parsers.M2obj module¶
officiumdivinum.parsers.T2obj module¶
Parse Divinumofficium’s Temporal files into Feast objects.
-
officiumdivinum.parsers.T2obj.parse_DO_sections(lines: list) → list[source]¶ Parse DO files into lists per section.
- Parameters
lines (list : lines to break into sections.)
- Returns
A list of sections.
-
officiumdivinum.parsers.T2obj.parse_file(fn: pathlib.Path, calendar: str) → officiumdivinum.objects.datastructures.Feast[source]¶ Parse provided file.
- Parameters
fn (Path : File to parse.)
calendar (str: Calendar to use (mainly for naming at this stage).)
- Returns
A Feast object represeting the day.