python-fasthtml 0.14.1__tar.gz → 0.14.2__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.
- {python_fasthtml-0.14.1/python_fasthtml.egg-info → python_fasthtml-0.14.2}/PKG-INFO +2 -2
- python_fasthtml-0.14.2/fasthtml/__init__.py +2 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/_modidx.py +2 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/components.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/core.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/js.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/jupyter.py +24 -5
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/oauth.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/pico.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/stripe_otp.py +2 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/svg.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/xtend.py +3 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/pyproject.toml +1 -1
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2/python_fasthtml.egg-info}/PKG-INFO +2 -2
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/python_fasthtml.egg-info/requires.txt +1 -1
- python_fasthtml-0.14.1/fasthtml/__init__.py +0 -2
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/CONTRIBUTING.md +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/LICENSE +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/MANIFEST.in +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/README.md +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/authmw.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/basics.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/cli.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/common.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/components.pyi +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/core.pyi +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/fastapp.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/ft.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/katex.js +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/live_reload.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/starlette.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/toaster.py +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/fasthtml/xtend.pyi +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/setup.cfg +0 -0
- {python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/tests/test_toaster.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
4
4
|
Summary: The fastest way to create an HTML app
|
|
5
5
|
Author-email: Jeremy Howard and contributors <github@jhoward.fastmail.fm>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: fastcore>=1.12.45
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
|
-
Requires-Dist: starlette
|
|
20
|
+
Requires-Dist: starlette>=1.0.1
|
|
21
21
|
Requires-Dist: oauthlib
|
|
22
22
|
Requires-Dist: itsdangerous
|
|
23
23
|
Requires-Dist: uvicorn[standard]>=0.30
|
|
@@ -173,6 +173,8 @@ d = { 'settings': { 'branch': 'main',
|
|
|
173
173
|
'fasthtml.jupyter': { 'fasthtml.jupyter.HTMX': ('api/jupyter.html#htmx', 'fasthtml/jupyter.py'),
|
|
174
174
|
'fasthtml.jupyter.JupyUvi': ('api/jupyter.html#jupyuvi', 'fasthtml/jupyter.py'),
|
|
175
175
|
'fasthtml.jupyter.JupyUvi.__init__': ('api/jupyter.html#jupyuvi.__init__', 'fasthtml/jupyter.py'),
|
|
176
|
+
'fasthtml.jupyter.JupyUvi._live_sse': ('api/jupyter.html#jupyuvi._live_sse', 'fasthtml/jupyter.py'),
|
|
177
|
+
'fasthtml.jupyter.JupyUvi._setup_live': ('api/jupyter.html#jupyuvi._setup_live', 'fasthtml/jupyter.py'),
|
|
176
178
|
'fasthtml.jupyter.JupyUvi.start': ('api/jupyter.html#jupyuvi.start', 'fasthtml/jupyter.py'),
|
|
177
179
|
'fasthtml.jupyter.JupyUvi.start_async': ('api/jupyter.html#jupyuvi.start_async', 'fasthtml/jupyter.py'),
|
|
178
180
|
'fasthtml.jupyter.JupyUvi.stop': ('api/jupyter.html#jupyuvi.stop', 'fasthtml/jupyter.py'),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"""`ft_html` and `ft_hx` functions to add some conveniences to `ft`, along with a full set of basic HTML components, and functions to work with forms and `FT` conversion
|
|
1
|
+
"""`ft_html` and `ft_hx` functions to add some conveniences to `ft`, along with a full set of basic HTML components, and functions to work with forms and `FT` conversion
|
|
2
|
+
|
|
3
|
+
Docs: https://www.fastht.ml/docsapi/components.html.md"""
|
|
2
4
|
|
|
3
5
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/01_components.ipynb.
|
|
4
6
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"""Use FastHTML in Jupyter notebooks
|
|
1
|
+
"""Use FastHTML in Jupyter notebooks
|
|
2
|
+
|
|
3
|
+
Docs: https://www.fastht.ml/docsapi/jupyter.html.md"""
|
|
2
4
|
|
|
3
5
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/06_jupyter.ipynb.
|
|
4
6
|
|
|
@@ -79,16 +81,18 @@ document.body.addEventListener('htmx:configRequest', (event) => {
|
|
|
79
81
|
});
|
|
80
82
|
</script>''' % port))
|
|
81
83
|
|
|
82
|
-
# %% ../nbs/api/06_jupyter.ipynb #
|
|
84
|
+
# %% ../nbs/api/06_jupyter.ipynb #79406618
|
|
83
85
|
class JupyUvi:
|
|
84
86
|
"Start and stop a Jupyter compatible uvicorn server with ASGI `app` on `port` with `log_level`"
|
|
85
|
-
def __init__(self, app, log_level="error", host='0.0.0.0', port=8000, start=True, daemon=False, **kwargs):
|
|
87
|
+
def __init__(self, app, log_level="error", host='0.0.0.0', port=8000, start=True, live=False, live_rt='/_lr', daemon=False, **kwargs):
|
|
86
88
|
self.kwargs = kwargs
|
|
87
|
-
store_attr(but='start')
|
|
89
|
+
store_attr(but='start,live')
|
|
88
90
|
self.server = None
|
|
91
|
+
self._live_ver = 0
|
|
92
|
+
if live: self._setup_live(app)
|
|
89
93
|
if start: self.start()
|
|
90
94
|
if not os.environ.get('IN_SOLVEIT'): htmx_config_port(port)
|
|
91
|
-
|
|
95
|
+
|
|
92
96
|
def start(self):
|
|
93
97
|
self.server = nb_serve(self.app, log_level=self.log_level, host=self.host, port=self.port,daemon=self.daemon, **self.kwargs)
|
|
94
98
|
|
|
@@ -99,6 +103,21 @@ class JupyUvi:
|
|
|
99
103
|
self.server.should_exit = True
|
|
100
104
|
wait_port_free(self.port)
|
|
101
105
|
|
|
106
|
+
def _setup_live(self, app):
|
|
107
|
+
rt = self.live_rt or '/_lr'
|
|
108
|
+
if not rt.startswith('/'): rt = f'/{rt}'
|
|
109
|
+
app.hdrs.append(Script(f"new EventSource({rt!r}).onmessage=e=>{{if(e.data==='reload')navigation.reload()}}"))
|
|
110
|
+
@app.get(rt)
|
|
111
|
+
async def _sse(): return EventStream(self._live_sse())
|
|
112
|
+
get_ipython().events.register('post_run_cell', lambda _: setattr(self, '_live_ver', self._live_ver+1))
|
|
113
|
+
|
|
114
|
+
async def _live_sse(self):
|
|
115
|
+
ver = self._live_ver
|
|
116
|
+
while not self.server.should_exit:
|
|
117
|
+
await asyncio.sleep(0.1)
|
|
118
|
+
if ver != self._live_ver:
|
|
119
|
+
ver = self._live_ver
|
|
120
|
+
yield 'data: reload\n\n'
|
|
102
121
|
|
|
103
122
|
# %% ../nbs/api/06_jupyter.ipynb #9134035e
|
|
104
123
|
class JupyUviAsync(JupyUvi):
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"""Simple extensions to standard HTML components, such as adding sensible defaults
|
|
1
|
+
"""Simple extensions to standard HTML components, such as adding sensible defaults
|
|
2
|
+
|
|
3
|
+
Docs: https://www.fastht.ml/docsapi/xtend.html.md"""
|
|
2
4
|
|
|
3
5
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/02_xtend.ipynb.
|
|
4
6
|
|
|
@@ -12,7 +12,7 @@ license = {text = "Apache-2.0"}
|
|
|
12
12
|
authors = [{name = "Jeremy Howard and contributors", email = "github@jhoward.fastmail.fm"}]
|
|
13
13
|
keywords = ['nbdev', 'jupyter', 'notebook', 'python']
|
|
14
14
|
classifiers = ["Natural Language :: English", "Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only"]
|
|
15
|
-
dependencies = ['fastcore>=1.12.45', 'python-dateutil', 'starlette
|
|
15
|
+
dependencies = ['fastcore>=1.12.45', 'python-dateutil', 'starlette>=1.0.1', 'oauthlib', 'itsdangerous', 'uvicorn[standard]>=0.30', 'httpx', 'fastlite>=0.1.1', 'python-multipart', 'beautifulsoup4']
|
|
16
16
|
|
|
17
17
|
[project.urls]
|
|
18
18
|
Repository = "https://github.com/AnswerDotAI/fasthtml"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
4
4
|
Summary: The fastest way to create an HTML app
|
|
5
5
|
Author-email: Jeremy Howard and contributors <github@jhoward.fastmail.fm>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: fastcore>=1.12.45
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
|
-
Requires-Dist: starlette
|
|
20
|
+
Requires-Dist: starlette>=1.0.1
|
|
21
21
|
Requires-Dist: oauthlib
|
|
22
22
|
Requires-Dist: itsdangerous
|
|
23
23
|
Requires-Dist: uvicorn[standard]>=0.30
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fasthtml-0.14.1 → python_fasthtml-0.14.2}/python_fasthtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|