MCPcopy Create free account
hub / github.com/datapane/datapane / stringify_report

Function stringify_report

python-client/src/datapane/processors/api.py:104–126  ·  view source on GitHub ↗

Stringify the app document to a HTML string Args: blocks: The `Blocks` object or a list of Blocks name: Name of the document (optional: uses path if not provided) formatting: Sets the basic app styling

(
    blocks: BlocksT,
    name: t.Optional[str] = None,
    formatting: t.Optional[Formatting] = None,
)

Source from the content-addressed store, hash-verified

102
103
104def stringify_report(
105 blocks: BlocksT,
106 name: t.Optional[str] = None,
107 formatting: t.Optional[Formatting] = None,
108) -> str:
109 """Stringify the app document to a HTML string
110
111 Args:
112 blocks: The `Blocks` object or a list of Blocks
113 name: Name of the document (optional: uses path if not provided)
114 formatting: Sets the basic app styling
115 """
116
117 s = ViewState(blocks=Blocks.wrap_blocks(blocks), file_entry_klass=B64FileEntry)
118 report_html: str = (
119 Pipeline(s)
120 .pipe(PreProcessView(is_finalised=False))
121 .pipe(ConvertXML())
122 .pipe(ExportHTMLStringInlineAssets(name=name, formatting=formatting))
123 .result
124 )
125
126 return report_html
127
128
129def upload_report(

Callers 2

_ipython_display_Method · 0.90
stringifyMethod · 0.85

Calls 7

ViewStateClass · 0.85
PipelineClass · 0.85
PreProcessViewClass · 0.85
ConvertXMLClass · 0.85
wrap_blocksMethod · 0.80
pipeMethod · 0.80

Tested by

no test coverage detected