mirror of
https://git.pumpin.online/funkpower/typikon.git
synced 2026-10-22 18:57:13 +00:00
Two adversarial reviews of the release. Both said do not ship, and they were right twice over. The seven-day view panicked. elide() cut a title at cut.len() / 2, a byte index into a string it had counted in characters, and every movable feast title carries an em dash: at fourteen terminal widths, 80 among them, it aborted with exit 101 on the README's own headline command. tests/elide.rs now cuts every title the program can print at every width it can be asked to print at. The changelog's first Calendar entry was false. It said a vigil or polyeleos saint reaches fish in the three lesser fasts; the code gives wine and oil to every rank but great, and caps the Dormition Fast at wine and oil whatever the rank. A reader in the Dormition Fast was told this release let a saint bring fish. docs/versioning.md makes that section a contract, so a wrong entry there is worse than a wrong comment. The Python bindings read the config file where the CLI reads the environment first, so TYPIKON_JURISDICTION moved one and not the other and the two answered for different churches on the same machine. CI now asserts they agree, and runs the README example checker, which was standing between the docs and reality with nothing running it. Three changes to the surface, made now because after 1.0.0 they are a major version: binds is null rather than the string none where a church legislates no binding fast at all; iCalendar UIDs carry the tradition and the discipline, which two feeds of the same day were sharing while saying different things; and Date's Julian Day Number is behind an accessor rather than a public field. fastLabel, emoji and reason are documented as presentation. The fields are stable, the wording is not, and freezing three human-facing strings for a major version was not the intent.
84 lines
2.3 KiB
Python
84 lines
2.3 KiB
Python
import datetime
|
|
from typing import Any, Final
|
|
|
|
__version__: Final[str]
|
|
|
|
class Day:
|
|
"""One day, fully reckoned. Immutable."""
|
|
|
|
@property
|
|
def date(self) -> datetime.date: ...
|
|
@property
|
|
def iso(self) -> str: ...
|
|
@property
|
|
def weekday(self) -> str: ...
|
|
@property
|
|
def jurisdiction(self) -> str: ...
|
|
@property
|
|
def calendar(self) -> str: ...
|
|
@property
|
|
def church_date(self) -> str:
|
|
"""The ecclesiastical date, as "25 December"."""
|
|
@property
|
|
def season(self) -> str | None: ...
|
|
@property
|
|
def cycle(self) -> str | None: ...
|
|
@property
|
|
def feast(self) -> str | None: ...
|
|
@property
|
|
def rank(self) -> str | None: ...
|
|
@property
|
|
def sign(self) -> str | None:
|
|
"""The mark the liturgical books print beside a day of this rank."""
|
|
@property
|
|
def tradition(self) -> str:
|
|
"""Greek or Slavic usage, as this jurisdiction reads the Typikon."""
|
|
@property
|
|
def title(self) -> str:
|
|
"""The feast if there is one, else the principal commemoration."""
|
|
@property
|
|
def commemorations(self) -> list[str]: ...
|
|
@property
|
|
def fast(self) -> str: ...
|
|
@property
|
|
def fast_label(self) -> str: ...
|
|
@property
|
|
def emoji(self) -> str: ...
|
|
@property
|
|
def reason(self) -> str: ...
|
|
@property
|
|
def obligation(self) -> str | None:
|
|
"""``"obligatory"``, ``"customary"``, or ``None``."""
|
|
@property
|
|
def binds(self) -> str | None: ...
|
|
@property
|
|
def pascha(self) -> datetime.date: ...
|
|
@property
|
|
def days_to_pascha(self) -> int: ...
|
|
@property
|
|
def julian_offset(self) -> int: ...
|
|
def is_obligatory(self) -> bool: ...
|
|
def to_dict(self) -> dict[str, Any]:
|
|
"""The same fields as ``typikon --json``."""
|
|
|
|
def describe(
|
|
date: datetime.date,
|
|
jurisdiction: str | None = None,
|
|
tradition: str | None = None,
|
|
typikon: bool | None = None,
|
|
) -> Day: ...
|
|
def today(
|
|
jurisdiction: str | None = None,
|
|
tradition: str | None = None,
|
|
typikon: bool | None = None,
|
|
) -> Day: ...
|
|
def week(
|
|
start: datetime.date,
|
|
days: int = 7,
|
|
jurisdiction: str | None = None,
|
|
tradition: str | None = None,
|
|
typikon: bool | None = None,
|
|
) -> list[Day]: ...
|
|
def pascha(year: int, jurisdiction: str | None = None) -> datetime.date: ...
|
|
def jurisdictions() -> list[dict[str, str]]: ...
|