python-fasthtml 0.10.2__tar.gz → 0.11.0__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.10.2/python_fasthtml.egg-info → python_fasthtml-0.11.0}/PKG-INFO +1 -1
- python_fasthtml-0.11.0/fasthtml/__init__.py +2 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/_modidx.py +5 -1
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/common.py +1 -1
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/components.py +15 -3
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/core.py +8 -3
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0/python_fasthtml.egg-info}/PKG-INFO +1 -1
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/settings.ini +1 -1
- python_fasthtml-0.10.2/fasthtml/__init__.py +0 -2
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/CONTRIBUTING.md +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/LICENSE +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/MANIFEST.in +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/README.md +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/authmw.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/basics.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/cli.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/components.pyi +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/core.pyi +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/fastapp.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/ft.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/js.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/jupyter.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/katex.js +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/live_reload.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/oauth.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/pico.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/starlette.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/svg.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/toaster.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/xtend.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/fasthtml/xtend.pyi +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/pyproject.toml +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/python_fasthtml.egg-info/not-zip-safe +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/python_fasthtml.egg-info/requires.txt +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/setup.cfg +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/setup.py +0 -0
- {python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/tests/test_toaster.py +0 -0
|
@@ -11,7 +11,10 @@ d = { 'settings': { 'branch': 'main',
|
|
|
11
11
|
'fasthtml.cli.railway_deploy': ('api/cli.html#railway_deploy', 'fasthtml/cli.py'),
|
|
12
12
|
'fasthtml.cli.railway_link': ('api/cli.html#railway_link', 'fasthtml/cli.py')},
|
|
13
13
|
'fasthtml.common': {},
|
|
14
|
-
'fasthtml.components': { 'fasthtml.components.
|
|
14
|
+
'fasthtml.components': { 'fasthtml.components.FT.__add__': ('api/components.html#ft.__add__', 'fasthtml/components.py'),
|
|
15
|
+
'fasthtml.components.FT.__radd__': ('api/components.html#ft.__radd__', 'fasthtml/components.py'),
|
|
16
|
+
'fasthtml.components.FT.__str__': ('api/components.html#ft.__str__', 'fasthtml/components.py'),
|
|
17
|
+
'fasthtml.components.File': ('api/components.html#file', 'fasthtml/components.py'),
|
|
15
18
|
'fasthtml.components.__getattr__': ('api/components.html#__getattr__', 'fasthtml/components.py'),
|
|
16
19
|
'fasthtml.components._fill_item': ('api/components.html#_fill_item', 'fasthtml/components.py'),
|
|
17
20
|
'fasthtml.components.attrmap_x': ('api/components.html#attrmap_x', 'fasthtml/components.py'),
|
|
@@ -103,6 +106,7 @@ d = { 'settings': { 'branch': 'main',
|
|
|
103
106
|
'fasthtml.core.flat_xt': ('api/core.html#flat_xt', 'fasthtml/core.py'),
|
|
104
107
|
'fasthtml.core.form2dict': ('api/core.html#form2dict', 'fasthtml/core.py'),
|
|
105
108
|
'fasthtml.core.get_key': ('api/core.html#get_key', 'fasthtml/core.py'),
|
|
109
|
+
'fasthtml.core.nested_name': ('api/core.html#nested_name', 'fasthtml/core.py'),
|
|
106
110
|
'fasthtml.core.noop_body': ('api/core.html#noop_body', 'fasthtml/core.py'),
|
|
107
111
|
'fasthtml.core.parse_form': ('api/core.html#parse_form', 'fasthtml/core.py'),
|
|
108
112
|
'fasthtml.core.parsed_date': ('api/core.html#parsed_date', 'fasthtml/core.py'),
|
|
@@ -37,6 +37,18 @@ def show(ft,*rest):
|
|
|
37
37
|
if rest: ft = (ft,)+rest
|
|
38
38
|
display.display(display.HTML(to_xml(ft)))
|
|
39
39
|
|
|
40
|
+
# %% ../nbs/api/01_components.ipynb
|
|
41
|
+
@patch
|
|
42
|
+
def __str__(self:FT): return self.id if self.id else object.__str__(self)
|
|
43
|
+
|
|
44
|
+
# %% ../nbs/api/01_components.ipynb
|
|
45
|
+
@patch
|
|
46
|
+
def __radd__(self:FT, b): return f'{b}{self}'
|
|
47
|
+
|
|
48
|
+
# %% ../nbs/api/01_components.ipynb
|
|
49
|
+
@patch
|
|
50
|
+
def __add__(self:FT, b): return f'{self}{b}'
|
|
51
|
+
|
|
40
52
|
# %% ../nbs/api/01_components.ipynb
|
|
41
53
|
named = set('a button form frame iframe img input map meta object param select textarea'.split())
|
|
42
54
|
html_attrs = 'id cls title style accesskey contenteditable dir draggable enterkeyhint hidden inert inputmode lang popover spellcheck tabindex translate'.split()
|
|
@@ -69,14 +81,14 @@ fh_cfg['auto_id']=False
|
|
|
69
81
|
fh_cfg['auto_name']=True
|
|
70
82
|
|
|
71
83
|
# %% ../nbs/api/01_components.ipynb
|
|
72
|
-
def ft_html(tag: str, *c, id=None, cls=None, title=None, style=None, attrmap=None, valmap=None, ft_cls=None,
|
|
84
|
+
def ft_html(tag: str, *c, id=None, cls=None, title=None, style=None, attrmap=None, valmap=None, ft_cls=None, **kwargs):
|
|
73
85
|
ds,c = partition(c, risinstance(dict))
|
|
74
86
|
for d in ds: kwargs = {**kwargs, **d}
|
|
75
87
|
if ft_cls is None: ft_cls = fh_cfg.ft_cls
|
|
76
88
|
if attrmap is None: attrmap=fh_cfg.attrmap
|
|
77
89
|
if valmap is None: valmap =fh_cfg.valmap
|
|
78
|
-
if
|
|
79
|
-
if
|
|
90
|
+
if not id and fh_cfg.auto_id: id = True
|
|
91
|
+
if id and isinstance(id,bool): id = unqid()
|
|
80
92
|
kwargs['id'] = id.id if isinstance(id,FT) else id
|
|
81
93
|
kwargs['cls'],kwargs['title'],kwargs['style'] = cls,title,style
|
|
82
94
|
tag,c,kw = ft(tag, *c, attrmap=attrmap, valmap=valmap, **kwargs).list
|
|
@@ -7,8 +7,8 @@ __all__ = ['empty', 'htmx_hdrs', 'fh_cfg', 'htmx_resps', 'htmx_exts', 'htmxsrc',
|
|
|
7
7
|
'charset', 'cors_allow', 'iframe_scr', 'all_meths', 'parsed_date', 'snake2hyphens', 'HtmxHeaders',
|
|
8
8
|
'HttpHeader', 'HtmxResponseHeaders', 'form2dict', 'parse_form', 'flat_xt', 'Beforeware', 'EventStream',
|
|
9
9
|
'signal_shutdown', 'uri', 'decode_uri', 'flat_tuple', 'noop_body', 'respond', 'Redirect', 'get_key', 'qp',
|
|
10
|
-
'def_hdrs', 'FastHTML', 'serve', 'Client', 'RouteFuncs', 'APIRouter', 'cookie',
|
|
11
|
-
'MiddlewareBase', 'FtResponse', 'unqid', 'setup_ws']
|
|
10
|
+
'def_hdrs', 'FastHTML', 'nested_name', 'serve', 'Client', 'RouteFuncs', 'APIRouter', 'cookie',
|
|
11
|
+
'reg_re_param', 'MiddlewareBase', 'FtResponse', 'unqid', 'setup_ws']
|
|
12
12
|
|
|
13
13
|
# %% ../nbs/api/00_core.ipynb
|
|
14
14
|
import json,uuid,inspect,types,uvicorn,signal,asyncio,threading,inspect
|
|
@@ -597,10 +597,15 @@ def _mk_locfunc(f,p):
|
|
|
597
597
|
def __str__(self): return p
|
|
598
598
|
return _lf()
|
|
599
599
|
|
|
600
|
+
# %% ../nbs/api/00_core.ipynb
|
|
601
|
+
def nested_name(f):
|
|
602
|
+
"Get name of function `f` using '_' to join nested function names"
|
|
603
|
+
return f.__qualname__.replace('.<locals>.', '_')
|
|
604
|
+
|
|
600
605
|
# %% ../nbs/api/00_core.ipynb
|
|
601
606
|
@patch
|
|
602
607
|
def _add_route(self:FastHTML, func, path, methods, name, include_in_schema, body_wrap):
|
|
603
|
-
n,fn,p = name,func
|
|
608
|
+
n,fn,p = name,nested_name(func),None if callable(path) else path
|
|
604
609
|
if methods: m = [methods] if isinstance(methods,str) else methods
|
|
605
610
|
elif fn in all_meths and p is not None: m = [fn]
|
|
606
611
|
else: m = ['get','post']
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[DEFAULT]
|
|
2
2
|
repo = fasthtml
|
|
3
3
|
lib_name = fasthtml
|
|
4
|
-
version = 0.
|
|
4
|
+
version = 0.11.0
|
|
5
5
|
min_python = 3.10
|
|
6
6
|
license = apache2
|
|
7
7
|
requirements = fastcore>=1.7.18 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.0.9 python-multipart beautifulsoup4
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fasthtml-0.10.2 → python_fasthtml-0.11.0}/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
|
|
File without changes
|
|
File without changes
|