python-fasthtml 0.3.2__tar.gz → 0.3.3__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.3.2/python_fasthtml.egg-info → python-fasthtml-0.3.3}/PKG-INFO +2 -2
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/__init__.py +1 -1
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/core.py +13 -5
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/fastapp.py +7 -4
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3/python_fasthtml.egg-info}/PKG-INFO +2 -2
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/requires.txt +1 -1
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/settings.ini +2 -2
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/CONTRIBUTING.md +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/LICENSE +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/MANIFEST.in +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/README.md +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/_modidx.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/authmw.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/cli.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/common.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/components.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/components.pyi +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/ft.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/js.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/live_reload.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/oauth.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/starlette.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/svg.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/toaster.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/xtend.py +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/fasthtml/xtend.pyi +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/not-zip-safe +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/setup.cfg +0 -0
- {python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: The fastest way to create an HTML app
|
|
5
5
|
Home-page: https://github.com/AnswerDotAI/fasthtml
|
|
6
6
|
Author: Jeremy Howard
|
|
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: fastcore>=1.6.
|
|
18
|
+
Requires-Dist: fastcore>=1.6.7
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
20
|
Requires-Dist: starlette>0.33
|
|
21
21
|
Requires-Dist: oauthlib
|
|
@@ -383,7 +383,8 @@ class _SessionMiddleware(SessionMiddleware):
|
|
|
383
383
|
class FastHTML(Starlette):
|
|
384
384
|
def __init__(self, debug=False, routes=None, middleware=None, exception_handlers=None,
|
|
385
385
|
on_startup=None, on_shutdown=None, lifespan=None, hdrs=None, ftrs=None,
|
|
386
|
-
before=None, after=None,
|
|
386
|
+
before=None, after=None, ws_hdr=False,
|
|
387
|
+
surreal=True, htmx=True, default_hdrs=True,
|
|
387
388
|
secret_key=None, session_cookie='session_', max_age=365*24*3600, sess_path='/',
|
|
388
389
|
same_site='lax', sess_https_only=False, sess_domain=None, key_fname='.sesskey',
|
|
389
390
|
htmlkw=None, **bodykw):
|
|
@@ -395,8 +396,11 @@ class FastHTML(Starlette):
|
|
|
395
396
|
middleware.append(sess)
|
|
396
397
|
hdrs,ftrs = listify(hdrs),listify(ftrs)
|
|
397
398
|
htmlkw = htmlkw or {}
|
|
398
|
-
if default_hdrs:
|
|
399
|
-
|
|
399
|
+
if default_hdrs:
|
|
400
|
+
if surreal: hdrs = [surrsrc,scopesrc] + hdrs
|
|
401
|
+
if htmx: hdrs = [htmxscr] + hdrs
|
|
402
|
+
if ws_hdr: hdrs = [htmxwsscr] + hdrs
|
|
403
|
+
hdrs = [charset, viewport] + hdrs
|
|
400
404
|
excs = {k:_wrap_ex(v, hdrs, ftrs, htmlkw, bodykw) for k,v in (exception_handlers or {}).items()}
|
|
401
405
|
super().__init__(debug, routes, middleware, excs, on_startup, on_shutdown, lifespan=lifespan)
|
|
402
406
|
self.router = RouterX(routes, on_startup=on_startup, on_shutdown=on_shutdown, lifespan=lifespan,
|
|
@@ -405,8 +409,12 @@ class FastHTML(Starlette):
|
|
|
405
409
|
def route(self, path:str, methods=None, name=None, include_in_schema=True):
|
|
406
410
|
"Add a route at `path`; the function name is the default method"
|
|
407
411
|
def f(func):
|
|
408
|
-
|
|
409
|
-
|
|
412
|
+
n = name
|
|
413
|
+
if methods:
|
|
414
|
+
m = [methods] if isinstance(methods,str) else methods
|
|
415
|
+
if not n: n = func.__name__
|
|
416
|
+
else: m = [func.__name__]
|
|
417
|
+
self.router.add_route(path, func, methods=m, name=n, include_in_schema=include_in_schema)
|
|
410
418
|
return func
|
|
411
419
|
return f
|
|
412
420
|
|
|
@@ -15,7 +15,7 @@ def get_tbl(dt, nm, schema):
|
|
|
15
15
|
if render: dc.__ft__ = render
|
|
16
16
|
return tbl,dc
|
|
17
17
|
|
|
18
|
-
def app_factory(*args, **kwargs) -> FastHTML | FastHTMLWithLiveReload:
|
|
18
|
+
def app_factory(*args, **kwargs) -> FastHTML | FastHTMLWithLiveReload:
|
|
19
19
|
"""Creates a FastHTML or FastHTMLWithLiveReload app instance.
|
|
20
20
|
The type of app created is determined by the "live" key in kwargs.
|
|
21
21
|
|
|
@@ -45,6 +45,8 @@ def fast_app(
|
|
|
45
45
|
lifespan:Optional[callable]=None, # Passed to Starlette
|
|
46
46
|
default_hdrs=True, # Include default FastHTML headers such as HTMX script?
|
|
47
47
|
pico:Optional[bool]=None, # Include PicoCSS header?
|
|
48
|
+
surreal:Optional[bool]=True, # Include surreal.js/scope headers?
|
|
49
|
+
htmx:Optional[bool]=True, # Include HTMX header?
|
|
48
50
|
ws_hdr:bool=False, # Include HTMX websocket extension header?
|
|
49
51
|
secret_key:Optional[str]=None, # Signing key for sessions
|
|
50
52
|
key_fname:str='.sesskey', # Session cookie signing key file name
|
|
@@ -54,8 +56,8 @@ def fast_app(
|
|
|
54
56
|
same_site:str='lax', # Session cookie same site policy
|
|
55
57
|
sess_https_only:bool=False, # Session cookie HTTPS only?
|
|
56
58
|
sess_domain:Optional[str]=None, # Session cookie domain
|
|
57
|
-
htmlkw:Optional[dict]=None,
|
|
58
|
-
bodykw:Optional[dict]=None,
|
|
59
|
+
htmlkw:Optional[dict]=None, # Attrs to add to the HTML tag
|
|
60
|
+
bodykw:Optional[dict]=None, # Attrs to add to the Body tag
|
|
59
61
|
reload_attempts:Optional[int]=1, # Number of reload attempts when live reloading
|
|
60
62
|
reload_interval:Optional[int]=1000, # Time between reload attempts in ms
|
|
61
63
|
**kwargs)->Any:
|
|
@@ -65,7 +67,8 @@ def fast_app(
|
|
|
65
67
|
app = app_factory(hdrs=h, ftrs=ftrs, before=before, middleware=middleware, live=live, debug=debug, routes=routes, exception_handlers=exception_handlers,
|
|
66
68
|
on_startup=on_startup, on_shutdown=on_shutdown, lifespan=lifespan, default_hdrs=default_hdrs, secret_key=secret_key,
|
|
67
69
|
session_cookie=session_cookie, max_age=max_age, sess_path=sess_path, same_site=same_site, sess_https_only=sess_https_only,
|
|
68
|
-
sess_domain=sess_domain, key_fname=key_fname, ws_hdr=ws_hdr,
|
|
70
|
+
sess_domain=sess_domain, key_fname=key_fname, ws_hdr=ws_hdr, surreal=surreal, htmx=htmx, htmlkw=htmlkw,
|
|
71
|
+
reload_attempts=reload_attempts, reload_interval=reload_interval, **(bodykw or {}))
|
|
69
72
|
|
|
70
73
|
@app.route("/{fname:path}.{ext:static}")
|
|
71
74
|
async def get(fname:str, ext:str): return FileResponse(f'{fname}.{ext}')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: The fastest way to create an HTML app
|
|
5
5
|
Home-page: https://github.com/AnswerDotAI/fasthtml
|
|
6
6
|
Author: Jeremy Howard
|
|
@@ -15,7 +15,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: fastcore>=1.6.
|
|
18
|
+
Requires-Dist: fastcore>=1.6.7
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
20
|
Requires-Dist: starlette>0.33
|
|
21
21
|
Requires-Dist: oauthlib
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[DEFAULT]
|
|
2
2
|
repo = fasthtml
|
|
3
3
|
lib_name = fasthtml
|
|
4
|
-
version = 0.3.
|
|
4
|
+
version = 0.3.3
|
|
5
5
|
min_python = 3.10
|
|
6
6
|
license = apache2
|
|
7
|
-
requirements = fastcore>=1.6.
|
|
7
|
+
requirements = fastcore>=1.6.7 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.0.6 python-multipart beautifulsoup4
|
|
8
8
|
dev_requirements = ipython lxml
|
|
9
9
|
black_formatting = False
|
|
10
10
|
conda_user = fastai
|
|
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
|
|
File without changes
|
|
File without changes
|
{python-fasthtml-0.3.2 → python-fasthtml-0.3.3}/python_fasthtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|