Skip to content

common_reports.schemas.builders.results

Builder operation outputs — what a render produces. Frozen value objects.

The format/styling CONFIG lives in contracts/builders/formats.py (decision (b)); this module is purely the RESULTS of a render. schemas/ may import contracts/ (TocEntry is a contract — re-exported here for convenience), never the reverse.

Classes

EmailPayload

A ready-to-send email — the composer output. multipart/mixed [G12].

__init__

def __init__(subject: str, html_body: str, recipients: tuple[str, ...] = (), attachments: tuple[Path, ...] = (), multipart_subtype: str = 'mixed') -> None

Fields and properties declared here; inherited members belong to the bases above.

attachments

attachments: tuple[Path, ...] = ()

html_body

html_body: str

multipart_subtype

multipart_subtype: str = 'mixed'

recipients

recipients: tuple[str, ...] = ()

subject

subject: str

FigureAsset

A rendered figure in its target forms. Order = (interactive, static, url) [G16].

__init__

def __init__(interactive_html: str = '', static_png: str = '', hosted_url: str | None = None) -> None

Fields and properties declared here; inherited members belong to the bases above.

hosted_url

hosted_url: str | None = None

interactive_html

interactive_html: str = ''

static_png

static_png: str = ''

GhostPost

A Ghost Admin post payload (Mobiledoc single HTML-card).

__init__

def __init__(title: str, mobiledoc: str, status: str = 'draft', tags: tuple[str, ...] = (), visibility: str = 'public', authors: tuple[Mapping[str, str], ...] = _ORIGIN_AUTHORS) -> None

Fields and properties declared here; inherited members belong to the bases above.

authors

authors: tuple[Mapping[str, str], ...] = _ORIGIN_AUTHORS

mobiledoc

mobiledoc: str

status

status: str = 'draft'

tags

tags: tuple[str, ...] = ()

title

title: str

visibility

visibility: str = 'public'

mobiledoc_for

@staticmethod
def mobiledoc_for(html: str) -> str

EXACT Mobiledoc html-card payload (verified: ghost.py generate_post).

RenderResult

The output of a render — the HTML plus an asset manifest.

attachments holds the inline image parts an email render referenced as cid: (EmailRenderer(images="cid")); send them with the HTML: client.send(to, subject, html=result.html, attachments=result.attachments).

__init__

def __init__(html: str, assets: tuple[FigureAsset, ...] = (), manifest: Mapping[str, Any] = dict(), attachments: tuple[Attachment, ...] = ()) -> None

Fields and properties declared here; inherited members belong to the bases above.

assets

assets: tuple[FigureAsset, ...] = ()

attachments

attachments: tuple[Attachment, ...] = ()

html

html: str

manifest

manifest: Mapping[str, Any] = field(default_factory=dict)

save

def save(path: str | Path) -> Path