narada 0.1.24__tar.gz → 0.1.26__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: narada
3
- Version: 0.1.24
3
+ Version: 0.1.26
4
4
  Summary: Python client SDK for Narada
5
5
  Project-URL: Homepage, https://github.com/NaradaAI/narada-python-sdk/narada
6
6
  Project-URL: Repository, https://github.com/NaradaAI/narada-python-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "narada"
3
- version = "0.1.24"
3
+ version = "0.1.26"
4
4
  description = "Python client SDK for Narada"
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -0,0 +1,21 @@
1
+ import webbrowser
2
+ from tempfile import NamedTemporaryFile
3
+
4
+
5
+ def render_html(html: str) -> None:
6
+ """
7
+ Renders HTML content by opening it in the default browser.
8
+
9
+ Args:
10
+ html: The HTML content to render.
11
+ """
12
+ with NamedTemporaryFile(
13
+ mode="w+t",
14
+ encoding="utf-8",
15
+ suffix=".html",
16
+ delete=False,
17
+ ) as temp:
18
+ temp.write(html)
19
+ path = temp.name
20
+
21
+ webbrowser.open_new_tab(f"file://{path}")
@@ -1,17 +0,0 @@
1
- import base64
2
- import webbrowser
3
-
4
-
5
- def render_html(html: str) -> None:
6
- """
7
- Renders HTML content by opening it in the default browser.
8
-
9
- Args:
10
- html: The HTML content to render.
11
- """
12
- # Encode HTML to base64 for data URL
13
- html_bytes = html.encode("utf-8")
14
- html_base64 = base64.b64encode(html_bytes).decode("utf-8")
15
- # Create data URL
16
- data_url = f"data:text/html;base64,{html_base64}"
17
- webbrowser.open_new_tab(data_url)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes