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

Method __init__

python-client/src/datapane/blocks/text.py:183–199  ·  view source on GitHub ↗

Args: url: The URL of the resource to be embedded width: The width of the embedded object (optional) height: The height of the embedded object (optional) name: A unique name for the block to reference when adding text or embedding (optional)

(self, url: str, width: int = 960, height: int = 540, name: BlockId = None, label: str = None)

Source from the content-addressed store, hash-verified

181 _tag = "Embed"
182
183 def __init__(self, url: str, width: int = 960, height: int = 540, name: BlockId = None, label: str = None):
184 """
185 Args:
186 url: The URL of the resource to be embedded
187 width: The width of the embedded object (optional)
188 height: The height of the embedded object (optional)
189 name: A unique name for the block to reference when adding text or embedding (optional)
190 label: A label used when displaying the block (optional)
191 """
192
193 result = get_embed_url(url, width=width, height=height)
194
195 # if "html" not in result:
196 # raise DPClientError(f"Can't embed result from provider for URL '{url}'")
197 super().__init__(
198 content=result.html, name=name, label=label, url=url, title=result.title, provider_name=result.provider
199 )

Callers

nothing calls this directly

Calls 2

get_embed_urlFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected