MCPcopy
hub / github.com/python-visualization/folium / temp_html_filepath

Function temp_html_filepath

folium/utilities.py:373–383  ·  view source on GitHub ↗

Yields the path of a temporary HTML file containing data.

(data: str)

Source from the content-addressed store, hash-verified

371
372@contextmanager
373def temp_html_filepath(data: str) -> Iterator[str]:
374 """Yields the path of a temporary HTML file containing data."""
375 filepath = ""
376 try:
377 fid, filepath = tempfile.mkstemp(suffix=".html", prefix="folium_")
378 os.write(fid, data.encode("utf8") if isinstance(data, str) else data)
379 os.close(fid)
380 yield filepath
381 finally:
382 if os.path.isfile(filepath):
383 os.remove(filepath)
384
385
386def deep_copy(item_original: Element) -> Element:

Callers 5

_to_pngMethod · 0.90
show_in_browserMethod · 0.90
get_notebook_htmlFunction · 0.90
test_geojsonFunction · 0.90

Calls

no outgoing calls

Tested by 3

get_notebook_htmlFunction · 0.72
test_geojsonFunction · 0.72