prescription.renderers.base#

BaseRenderer ABC for prescription renderers.

Kramer Harrison, 2026

Classes

BaseRenderer()

Consumes a Document and produces output.

class BaseRenderer[source]#

Consumes a Document and produces output.

abstractmethod render(document: Document) str[source]#

Return the rendered document as a string.

Parameters:

document – The document model to render.

Returns:

Rendered string (plain text, rich markup, or file path for PDF).

abstractmethod write(document: Document, path: str | os.PathLike) None[source]#

Render and write to a file.

Parameters:
  • document – The document model to render.

  • path – Output file path.