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

Method from_notebook

python-client/src/datapane/view/view_blocks.py:43–54  ·  view source on GitHub ↗
(
        cls, opt_out: bool = True, show_code: bool = False, show_markdown: bool = True, template: str = "auto"
    )

Source from the content-addressed store, hash-verified

41
42 @classmethod
43 def from_notebook(
44 cls, opt_out: bool = True, show_code: bool = False, show_markdown: bool = True, template: str = "auto"
45 ) -> Self:
46 from datapane.ipython import templates as ip_t
47 from datapane.ipython.utils import cells_to_blocks
48
49 blocks = cells_to_blocks(opt_out=opt_out, show_code=show_code, show_markdown=show_markdown)
50 app_template_cls = ip_t._registry.get(template) or ip_t.guess_template(blocks)
51 app_template = app_template_cls(blocks)
52 app_template.transform()
53 app_template.validate()
54 return cls(blocks=app_template.blocks)
55
56 def get_dom(self) -> ElementT:
57 """Return the Document structure for the View"""

Callers

nothing calls this directly

Calls 4

cells_to_blocksFunction · 0.90
validateMethod · 0.80
getMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected