python-fasthtml 0.4.1__tar.gz → 0.4.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.4.1/python_fasthtml.egg-info → python_fasthtml-0.4.3}/PKG-INFO +3 -3
- python_fasthtml-0.4.3/fasthtml/__init__.py +2 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/_modidx.py +1 -6
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/components.py +10 -9
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/components.pyi +8 -2
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/core.py +7 -34
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/xtend.py +13 -12
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3/python_fasthtml.egg-info}/PKG-INFO +3 -3
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/python_fasthtml.egg-info/requires.txt +2 -2
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/settings.ini +2 -2
- python-fasthtml-0.4.1/fasthtml/__init__.py +0 -2
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/CONTRIBUTING.md +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/LICENSE +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/MANIFEST.in +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/README.md +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/authmw.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/basics.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/cli.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/common.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/fastapp.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/ft.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/js.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/katex.js +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/live_reload.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/oauth.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/starlette.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/svg.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/toaster.py +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/fasthtml/xtend.pyi +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/python_fasthtml.egg-info/not-zip-safe +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/setup.cfg +0 -0
- {python-fasthtml-0.4.1 → python_fasthtml-0.4.3}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.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,14 +15,14 @@ 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.7.
|
|
18
|
+
Requires-Dist: fastcore>=1.7.1
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
20
|
Requires-Dist: starlette>0.33
|
|
21
21
|
Requires-Dist: oauthlib
|
|
22
22
|
Requires-Dist: itsdangerous
|
|
23
23
|
Requires-Dist: uvicorn[standard]>=0.30
|
|
24
24
|
Requires-Dist: httpx
|
|
25
|
-
Requires-Dist: fastlite>=0.0.
|
|
25
|
+
Requires-Dist: fastlite>=0.0.9
|
|
26
26
|
Requires-Dist: python-multipart
|
|
27
27
|
Requires-Dist: beautifulsoup4
|
|
28
28
|
Provides-Extra: dev
|
|
@@ -45,9 +45,6 @@ d = { 'settings': { 'branch': 'main',
|
|
|
45
45
|
'fasthtml.core.StringConvertor.to_string': ('api/core.html#stringconvertor.to_string', 'fasthtml/core.py'),
|
|
46
46
|
'fasthtml.core.WS_RouteX': ('api/core.html#ws_routex', 'fasthtml/core.py'),
|
|
47
47
|
'fasthtml.core.WS_RouteX.__init__': ('api/core.html#ws_routex.__init__', 'fasthtml/core.py'),
|
|
48
|
-
'fasthtml.core._SessionMiddleware': ('api/core.html#_sessionmiddleware', 'fasthtml/core.py'),
|
|
49
|
-
'fasthtml.core._SessionMiddleware.__call__': ( 'api/core.html#_sessionmiddleware.__call__',
|
|
50
|
-
'fasthtml/core.py'),
|
|
51
48
|
'fasthtml.core._annotations': ('api/core.html#_annotations', 'fasthtml/core.py'),
|
|
52
49
|
'fasthtml.core._apply_ft': ('api/core.html#_apply_ft', 'fasthtml/core.py'),
|
|
53
50
|
'fasthtml.core._find_p': ('api/core.html#_find_p', 'fasthtml/core.py'),
|
|
@@ -80,8 +77,6 @@ d = { 'settings': { 'branch': 'main',
|
|
|
80
77
|
'fasthtml.core.flat_xt': ('api/core.html#flat_xt', 'fasthtml/core.py'),
|
|
81
78
|
'fasthtml.core.form2dict': ('api/core.html#form2dict', 'fasthtml/core.py'),
|
|
82
79
|
'fasthtml.core.get_key': ('api/core.html#get_key', 'fasthtml/core.py'),
|
|
83
|
-
'fasthtml.core.is_namedtuple': ('api/core.html#is_namedtuple', 'fasthtml/core.py'),
|
|
84
|
-
'fasthtml.core.is_typeddict': ('api/core.html#is_typeddict', 'fasthtml/core.py'),
|
|
85
80
|
'fasthtml.core.reg_re_param': ('api/core.html#reg_re_param', 'fasthtml/core.py'),
|
|
86
81
|
'fasthtml.core.serve': ('api/core.html#serve', 'fasthtml/core.py'),
|
|
87
82
|
'fasthtml.core.snake2hyphens': ('api/core.html#snake2hyphens', 'fasthtml/core.py'),
|
|
@@ -124,7 +119,7 @@ d = { 'settings': { 'branch': 'main',
|
|
|
124
119
|
'fasthtml.xtend.Any': ('api/xtend.html#any', 'fasthtml/xtend.py'),
|
|
125
120
|
'fasthtml.xtend.AnyNow': ('api/xtend.html#anynow', 'fasthtml/xtend.py'),
|
|
126
121
|
'fasthtml.xtend.Card': ('api/xtend.html#card', 'fasthtml/xtend.py'),
|
|
127
|
-
'fasthtml.xtend.
|
|
122
|
+
'fasthtml.xtend.CheckboxX': ('api/xtend.html#checkboxx', 'fasthtml/xtend.py'),
|
|
128
123
|
'fasthtml.xtend.Container': ('api/xtend.html#container', 'fasthtml/xtend.py'),
|
|
129
124
|
'fasthtml.xtend.DialogX': ('api/xtend.html#dialogx', 'fasthtml/xtend.py'),
|
|
130
125
|
'fasthtml.xtend.Favicon': ('api/xtend.html#favicon', 'fasthtml/xtend.py'),
|
|
@@ -5,13 +5,13 @@ __all__ = ['named', 'html_attrs', 'hx_attrs', 'show', 'attrmap_x', 'ft_html', 'f
|
|
|
5
5
|
'find_inputs', 'html2ft', 'A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi',
|
|
6
6
|
'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data',
|
|
7
7
|
'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe',
|
|
8
|
-
'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', '
|
|
9
|
-
'
|
|
10
|
-
'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output',
|
|
11
|
-
'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script',
|
|
12
|
-
'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup',
|
|
13
|
-
'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U',
|
|
14
|
-
'Video', 'Wbr']
|
|
8
|
+
'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Head', 'Header',
|
|
9
|
+
'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main',
|
|
10
|
+
'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output',
|
|
11
|
+
'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script',
|
|
12
|
+
'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup',
|
|
13
|
+
'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U',
|
|
14
|
+
'Ul', 'Var', 'Video', 'Wbr']
|
|
15
15
|
|
|
16
16
|
# %% ../nbs/api/01_components.ipynb
|
|
17
17
|
from dataclasses import dataclass, asdict, is_dataclass, make_dataclass, replace, astuple, MISSING
|
|
@@ -71,7 +71,8 @@ _all_ = [
|
|
|
71
71
|
'A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br',
|
|
72
72
|
'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn',
|
|
73
73
|
'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form',
|
|
74
|
-
'H1', '
|
|
74
|
+
'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Head', 'Header',
|
|
75
|
+
'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend', 'Li',
|
|
75
76
|
'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output',
|
|
76
77
|
'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search',
|
|
77
78
|
'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody',
|
|
@@ -90,7 +91,7 @@ def _fill_item(item, obj):
|
|
|
90
91
|
if isinstance(cs,tuple): cs = tuple(_fill_item(o, obj) for o in cs)
|
|
91
92
|
name = attr.get('name', None)
|
|
92
93
|
val = None if name is None else obj.get(name, None)
|
|
93
|
-
if val is not None:
|
|
94
|
+
if val is not None and not 'skip' in attr:
|
|
94
95
|
if tag=='input':
|
|
95
96
|
if attr.get('type', '') in ('checkbox','radio'):
|
|
96
97
|
if val: attr['checked'] = '1'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
__all__ = ['named', 'html_attrs', 'hx_attrs', 'show', 'attrmap_x', 'ft_html', 'ft_hx', 'File', 'fill_form', 'fill_dataclass', 'find_inputs', 'html2ft', 'A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
|
|
1
|
+
__all__ = ['named', 'html_attrs', 'hx_attrs', 'show', 'attrmap_x', 'ft_html', 'ft_hx', 'File', 'fill_form', 'fill_dataclass', 'find_inputs', 'html2ft', 'A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
|
|
2
2
|
from dataclasses import dataclass, asdict, is_dataclass, make_dataclass, replace, astuple, MISSING
|
|
3
3
|
from bs4 import BeautifulSoup, Comment
|
|
4
4
|
from fastcore.utils import *
|
|
5
5
|
from fastcore.xml import *
|
|
6
6
|
from fastcore.meta import use_kwargs, delegates
|
|
7
|
+
from fastcore.test import *
|
|
7
8
|
from .core import fh_cfg
|
|
8
9
|
import types, json
|
|
9
10
|
try:
|
|
@@ -31,7 +32,7 @@ def ft_html(tag: str, *c, id=None, cls=None, title=None, style=None, attrmap=Non
|
|
|
31
32
|
def ft_hx(tag: str, *c, target_id=None, hx_vals=None, **kwargs):
|
|
32
33
|
...
|
|
33
34
|
_g = globals()
|
|
34
|
-
_all_ = ['A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
|
|
35
|
+
_all_ = ['A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup', 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
|
|
35
36
|
for o in _all_:
|
|
36
37
|
_g[o] = partial(ft_hx, o.lower())
|
|
37
38
|
|
|
@@ -103,6 +104,11 @@ def Figure(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, access
|
|
|
103
104
|
def Footer(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
104
105
|
def Form(*c, name:Any=None, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
105
106
|
def H1(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
107
|
+
def H2(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
108
|
+
def H3(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
109
|
+
def H4(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
110
|
+
def H5(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
111
|
+
def H6(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
106
112
|
def Head(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
107
113
|
def Header(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
108
114
|
def Hgroup(*c, id:Any=None, cls:Any=None, title:Any=None, style:Any=None, accesskey:Any=None, contenteditable:Any=None, dir:Any=None, draggable:Any=None, enterkeyhint:Any=None, hidden:Any=None, inert:Any=None, inputmode:Any=None, lang:Any=None, popover:Any=None, spellcheck:Any=None, tabindex:Any=None, translate:Any=None, hx_get:Any=None, hx_post:Any=None, hx_put:Any=None, hx_delete:Any=None, hx_patch:Any=None, hx_trigger:Any=None, hx_target:Any=None, hx_swap:Any=None, hx_include:Any=None, hx_select:Any=None, hx_indicator:Any=None, hx_push_url:Any=None, hx_confirm:Any=None, hx_disable:Any=None, hx_replace_url:Any=None, hx_on:Any=None, **kwargs): ...
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# %% auto 0
|
|
4
4
|
__all__ = ['empty', 'htmx_hdrs', 'fh_cfg', 'htmxscr', 'htmxwsscr', 'surrsrc', 'scopesrc', 'viewport', 'charset', 'all_meths',
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
5
|
+
'date', 'snake2hyphens', 'HtmxHeaders', 'str2int', 'HttpHeader', 'form2dict', 'flat_xt', 'Beforeware',
|
|
6
|
+
'WS_RouteX', 'uri', 'decode_uri', 'RouteX', 'RouterX', 'get_key', 'FastHTML', 'serve', 'cookie',
|
|
7
|
+
'reg_re_param', 'MiddlewareBase']
|
|
8
8
|
|
|
9
9
|
# %% ../nbs/api/00_core.ipynb
|
|
10
10
|
import json,uuid,inspect,types,uvicorn
|
|
@@ -15,7 +15,7 @@ from fastcore.xml import *
|
|
|
15
15
|
from types import UnionType, SimpleNamespace as ns, GenericAlias
|
|
16
16
|
from typing import Optional, get_type_hints, get_args, get_origin, Union, Mapping, TypedDict, List, Any
|
|
17
17
|
from datetime import datetime
|
|
18
|
-
from dataclasses import dataclass,fields
|
|
18
|
+
from dataclasses import dataclass,fields
|
|
19
19
|
from collections import namedtuple
|
|
20
20
|
from inspect import isfunction,ismethod,Parameter,get_annotations
|
|
21
21
|
from functools import wraps, partialmethod, update_wrapper
|
|
@@ -33,17 +33,6 @@ empty = Parameter.empty
|
|
|
33
33
|
# %% ../nbs/api/00_core.ipynb
|
|
34
34
|
def _sig(f): return signature_ex(f, True)
|
|
35
35
|
|
|
36
|
-
# %% ../nbs/api/00_core.ipynb
|
|
37
|
-
def is_typeddict(cls:type)->bool:
|
|
38
|
-
"Check if `cls` is a `TypedDict`"
|
|
39
|
-
attrs = 'annotations', 'required_keys', 'optional_keys'
|
|
40
|
-
return isinstance(cls, type) and all(hasattr(cls, f'__{attr}__') for attr in attrs)
|
|
41
|
-
|
|
42
|
-
# %% ../nbs/api/00_core.ipynb
|
|
43
|
-
def is_namedtuple(cls):
|
|
44
|
-
"`True` if `cls` is a namedtuple type"
|
|
45
|
-
return issubclass(cls, tuple) and hasattr(cls, '_fields')
|
|
46
|
-
|
|
47
36
|
# %% ../nbs/api/00_core.ipynb
|
|
48
37
|
def date(s:str):
|
|
49
38
|
"Convert `s` to a datetime"
|
|
@@ -98,8 +87,8 @@ def _fix_anno(t):
|
|
|
98
87
|
t = first(o for o in get_args(t) if o!=type(None))
|
|
99
88
|
d = {bool: str2bool, int: str2int}
|
|
100
89
|
res = d.get(t, t)
|
|
101
|
-
if origin in (list,List):
|
|
102
|
-
return res
|
|
90
|
+
if origin in (list,List): return partial(_mk_list, res)
|
|
91
|
+
return lambda o: res(o[-1]) if isinstance(o,(list,tuple)) else res(o)
|
|
103
92
|
|
|
104
93
|
# %% ../nbs/api/00_core.ipynb
|
|
105
94
|
def _form_arg(k, v, d):
|
|
@@ -425,28 +414,12 @@ def _wrap_ex(f, hdrs, ftrs, htmlkw, bodykw):
|
|
|
425
414
|
return _resp(req, res)
|
|
426
415
|
return _f
|
|
427
416
|
|
|
428
|
-
# %% ../nbs/api/00_core.ipynb
|
|
429
|
-
class _SessionMiddleware(SessionMiddleware):
|
|
430
|
-
"Same as Starlette's `SessionMiddleware`, but wraps `session` in an AttrDict"
|
|
431
|
-
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
432
|
-
if scope["type"] not in ("http", "websocket"):
|
|
433
|
-
await self.app(scope, receive, send)
|
|
434
|
-
return
|
|
435
|
-
|
|
436
|
-
async def receive_wrapper():
|
|
437
|
-
message = await receive()
|
|
438
|
-
if "session" in scope and not isinstance(scope["session"], AttrDict):
|
|
439
|
-
scope["session"] = AttrDict(scope["session"])
|
|
440
|
-
return message
|
|
441
|
-
|
|
442
|
-
await super().__call__(scope, receive_wrapper, send)
|
|
443
|
-
|
|
444
417
|
# %% ../nbs/api/00_core.ipynb
|
|
445
418
|
class FastHTML(Starlette):
|
|
446
419
|
def __init__(self, debug=False, routes=None, middleware=None, exception_handlers=None,
|
|
447
420
|
on_startup=None, on_shutdown=None, lifespan=None, hdrs=None, ftrs=None,
|
|
448
421
|
before=None, after=None, ws_hdr=False,
|
|
449
|
-
surreal=True, htmx=True, default_hdrs=True, sess_cls=
|
|
422
|
+
surreal=True, htmx=True, default_hdrs=True, sess_cls=SessionMiddleware,
|
|
450
423
|
secret_key=None, session_cookie='session_', max_age=365*24*3600, sess_path='/',
|
|
451
424
|
same_site='lax', sess_https_only=False, sess_domain=None, key_fname='.sesskey',
|
|
452
425
|
htmlkw=None, **bodykw):
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/02_xtend.ipynb.
|
|
2
2
|
|
|
3
3
|
# %% auto 0
|
|
4
|
-
__all__ = ['picocss', 'picolink', 'picocondcss', 'picocondlink', 'set_pico_cls', 'A', 'Form', 'AX', '
|
|
5
|
-
'
|
|
4
|
+
__all__ = ['picocss', 'picolink', 'picocondcss', 'picocondlink', 'set_pico_cls', 'A', 'Form', 'AX', 'Hidden', 'CheckboxX', 'Card',
|
|
5
|
+
'Group', 'Search', 'Grid', 'DialogX', 'Container', 'Script', 'Style', 'double_braces', 'undouble_braces',
|
|
6
6
|
'loose_format', 'ScriptX', 'replace_css_vars', 'StyleX', 'On', 'Any', 'Prev', 'Now', 'AnyNow', 'run_js',
|
|
7
7
|
'Titled', 'Socials', 'Favicon', 'jsd', 'clear']
|
|
8
8
|
|
|
@@ -65,12 +65,19 @@ def AX(txt, hx_get=None, target_id=None, hx_swap=None, href='#', **kwargs)->FT:
|
|
|
65
65
|
|
|
66
66
|
# %% ../nbs/api/02_xtend.ipynb
|
|
67
67
|
@delegates(ft_hx, keep=True)
|
|
68
|
-
def
|
|
69
|
-
"
|
|
68
|
+
def Hidden(value:Any="", **kwargs)->FT:
|
|
69
|
+
"An Input of type 'hidden'"
|
|
70
|
+
return Input(type="hidden", value=value, **kwargs)
|
|
71
|
+
|
|
72
|
+
# %% ../nbs/api/02_xtend.ipynb
|
|
73
|
+
@delegates(ft_hx, keep=True)
|
|
74
|
+
def CheckboxX(checked:bool=False, label=None, value="1", id=None, name=None, **kwargs)->FT:
|
|
75
|
+
"A Checkbox optionally inside a Label, preceded by a `Hidden` with matching name"
|
|
76
|
+
if id and not name: name=id
|
|
70
77
|
if not checked: checked=None
|
|
71
|
-
res = Input(type="checkbox", checked=checked, value=value, **kwargs)
|
|
78
|
+
res = Input(type="checkbox", id=id, name=name, checked=checked, value=value, **kwargs)
|
|
72
79
|
if label: res = Label(res, label)
|
|
73
|
-
return res
|
|
80
|
+
return Hidden(name=name, skip=True, value=""), res
|
|
74
81
|
|
|
75
82
|
# %% ../nbs/api/02_xtend.ipynb
|
|
76
83
|
@delegates(ft_hx, keep=True)
|
|
@@ -106,12 +113,6 @@ def DialogX(*c, open=None, header=None, footer=None, id=None, **kwargs)->FT:
|
|
|
106
113
|
card = Card(*c, header=header, footer=footer, **kwargs)
|
|
107
114
|
return Dialog(card, open=open, id=id)
|
|
108
115
|
|
|
109
|
-
# %% ../nbs/api/02_xtend.ipynb
|
|
110
|
-
@delegates(ft_hx, keep=True)
|
|
111
|
-
def Hidden(value:Any="", **kwargs)->FT:
|
|
112
|
-
"An Input of type 'hidden'"
|
|
113
|
-
return Input(type="hidden", value=value, **kwargs)
|
|
114
|
-
|
|
115
116
|
# %% ../nbs/api/02_xtend.ipynb
|
|
116
117
|
@delegates(ft_hx, keep=True)
|
|
117
118
|
def Container(*args, **kwargs)->FT:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.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,14 +15,14 @@ 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.7.
|
|
18
|
+
Requires-Dist: fastcore>=1.7.1
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
20
|
Requires-Dist: starlette>0.33
|
|
21
21
|
Requires-Dist: oauthlib
|
|
22
22
|
Requires-Dist: itsdangerous
|
|
23
23
|
Requires-Dist: uvicorn[standard]>=0.30
|
|
24
24
|
Requires-Dist: httpx
|
|
25
|
-
Requires-Dist: fastlite>=0.0.
|
|
25
|
+
Requires-Dist: fastlite>=0.0.9
|
|
26
26
|
Requires-Dist: python-multipart
|
|
27
27
|
Requires-Dist: beautifulsoup4
|
|
28
28
|
Provides-Extra: dev
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[DEFAULT]
|
|
2
2
|
repo = fasthtml
|
|
3
3
|
lib_name = fasthtml
|
|
4
|
-
version = 0.4.
|
|
4
|
+
version = 0.4.3
|
|
5
5
|
min_python = 3.10
|
|
6
6
|
license = apache2
|
|
7
|
-
requirements = fastcore>=1.7.
|
|
7
|
+
requirements = fastcore>=1.7.1 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.0.9 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
|
{python-fasthtml-0.4.1 → python_fasthtml-0.4.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
|