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

Function save_report

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

Save the app document to a local HTML file Args: blocks: The `Blocks` object or a list of Blocks path: File path to store the document open: Open in your browser after creating (default: False) name: Name of the document (optional: uses path if not provided)

(
    blocks: BlocksT,
    path: str,
    open: bool = False,
    name: str = "Report",
    formatting: t.Optional[Formatting] = None,
)

Source from the content-addressed store, hash-verified

75
76
77def save_report(
78 blocks: BlocksT,
79 path: str,
80 open: bool = False,
81 name: str = "Report",
82 formatting: t.Optional[Formatting] = None,
83) -> None:
84 """Save the app document to a local HTML file
85
86 Args:
87 blocks: The `Blocks` object or a list of Blocks
88 path: File path to store the document
89 open: Open in your browser after creating (default: False)
90 name: Name of the document (optional: uses path if not provided)
91 formatting: Sets the basic app styling
92 """
93
94 s = ViewState(blocks=Blocks.wrap_blocks(blocks), file_entry_klass=B64FileEntry)
95 _: str = (
96 Pipeline(s)
97 .pipe(PreProcessView(is_finalised=True))
98 .pipe(ConvertXML())
99 .pipe(ExportHTMLInlineAssets(path=path, open=open, name=name, formatting=formatting))
100 .result
101 )
102
103
104def stringify_report(

Callers 1

saveMethod · 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