python-fasthtml 0.6.7__tar.gz → 0.6.9__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.
Files changed (42) hide show
  1. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/CONTRIBUTING.md +4 -1
  2. {python-fasthtml-0.6.7/python_fasthtml.egg-info → python-fasthtml-0.6.9}/PKG-INFO +1 -1
  3. python-fasthtml-0.6.9/fasthtml/__init__.py +2 -0
  4. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/_modidx.py +1 -1
  5. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/components.py +27 -12
  6. python-fasthtml-0.6.9/fasthtml/components.pyi +190 -0
  7. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/core.py +3 -3
  8. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/core.pyi +5 -1
  9. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/jupyter.py +2 -2
  10. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/oauth.py +13 -15
  11. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/xtend.pyi +5 -1
  12. python-fasthtml-0.6.9/pyproject.toml +3 -0
  13. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9/python_fasthtml.egg-info}/PKG-INFO +1 -1
  14. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/python_fasthtml.egg-info/SOURCES.txt +1 -0
  15. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/settings.ini +1 -1
  16. python-fasthtml-0.6.7/fasthtml/__init__.py +0 -2
  17. python-fasthtml-0.6.7/fasthtml/components.pyi +0 -185
  18. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/LICENSE +0 -0
  19. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/MANIFEST.in +0 -0
  20. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/README.md +0 -0
  21. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/authmw.py +0 -0
  22. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/basics.py +0 -0
  23. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/cli.py +0 -0
  24. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/common.py +0 -0
  25. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/fastapp.py +0 -0
  26. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/ft.py +0 -0
  27. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/js.py +0 -0
  28. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/katex.js +0 -0
  29. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/live_reload.py +0 -0
  30. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/pico.py +0 -0
  31. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/starlette.py +0 -0
  32. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/svg.py +0 -0
  33. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/toaster.py +0 -0
  34. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/fasthtml/xtend.py +0 -0
  35. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/python_fasthtml.egg-info/dependency_links.txt +0 -0
  36. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/python_fasthtml.egg-info/entry_points.txt +0 -0
  37. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/python_fasthtml.egg-info/not-zip-safe +0 -0
  38. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/python_fasthtml.egg-info/requires.txt +0 -0
  39. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/python_fasthtml.egg-info/top_level.txt +0 -0
  40. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/setup.cfg +0 -0
  41. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/setup.py +0 -0
  42. {python-fasthtml-0.6.7 → python-fasthtml-0.6.9}/tests/test_toaster.py +0 -0
@@ -1,6 +1,9 @@
1
1
  # How to contribute
2
2
 
3
- This project uses [nbdev](https://nbdev.fast.ai/getting_started.html) for development. Before beginning, make sure that nbdev and a jupyter-compatible client such as jupyterlab or nbclassic are installed. To make changes, update the notebooks in the `nbs` folder, not the .py files directly. Then, run `nbdev_export`. For more details, have a look at the [nbdev tutorial](https://nbdev.fast.ai/tutorials/tutorial.html).
3
+ Make sure you have read the [doc on code style](
4
+ https://docs.fast.ai/dev/style.html) first. (Note that we don't follow PEP8, but instead follow a coding style designed specifically for numerical and interactive programming.)
5
+
6
+ This project uses [nbdev](https://nbdev.fast.ai/getting_started.html) for development. Before beginning, make sure that nbdev and a jupyter-compatible client such as jupyterlab or nbclassic are installed. To make changes, update the notebooks in the `nbs` folder, not the .py files directly. Then, run `nbdev_export`. For more details, have a look at the [nbdev tutorial](https://nbdev.fast.ai/tutorials/tutorial.html). Depending on the code changes, you might also need to run `tools/update.sh` to update python interface modules and [LLM reference material](https://github.com/AnswerDotAI/llms-txt).
4
7
 
5
8
  You may want to set up a `prep` alias in `~/.zshrc` or other shell startup file:
6
9
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-fasthtml
3
- Version: 0.6.7
3
+ Version: 0.6.9
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
@@ -0,0 +1,2 @@
1
+ __version__ = "0.6.9"
2
+ from .core import *
@@ -160,7 +160,7 @@ d = { 'settings': { 'branch': 'main',
160
160
  'fasthtml/oauth.py'),
161
161
  'fasthtml.oauth._AppClient.retr_id': ('api/oauth.html#_appclient.retr_id', 'fasthtml/oauth.py'),
162
162
  'fasthtml.oauth._AppClient.retr_info': ('api/oauth.html#_appclient.retr_info', 'fasthtml/oauth.py'),
163
- 'fasthtml.oauth.decode': ('api/oauth.html#decode', 'fasthtml/oauth.py')},
163
+ 'fasthtml.oauth.redir_url': ('api/oauth.html#redir_url', 'fasthtml/oauth.py')},
164
164
  'fasthtml.pico': { 'fasthtml.pico.Card': ('api/pico.html#card', 'fasthtml/pico.py'),
165
165
  'fasthtml.pico.Container': ('api/pico.html#container', 'fasthtml/pico.py'),
166
166
  'fasthtml.pico.DialogX': ('api/pico.html#dialogx', 'fasthtml/pico.py'),
@@ -3,21 +3,22 @@
3
3
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/01_components.ipynb.
4
4
 
5
5
  # %% auto 0
6
- __all__ = ['named', 'html_attrs', 'hx_attrs', 'show', 'attrmap_x', 'ft_html', 'ft_hx', 'File', 'fill_form', 'fill_dataclass',
7
- 'find_inputs', 'html2ft', 'sse_message', 'A', 'Abbr', 'Address', 'Area', 'Article', 'Aside', 'Audio', 'B',
8
- 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas', 'Caption', 'Cite', 'Code', 'Col',
9
- 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog', 'Div', 'Dl', 'Dt', 'Em', 'Embed',
10
- 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
11
- 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins', 'Kbd', 'Label', 'Legend',
12
- 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript', 'Object', 'Ol', 'Optgroup',
13
- 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q', 'Rp', 'Rt', 'Ruby', 'S',
14
- 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span', 'Strong', 'Style', 'Sub',
15
- 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th', 'Thead', 'Time', 'Title',
16
- 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
6
+ __all__ = ['named', 'html_attrs', 'hx_attrs', 'hx_attrs_annotations', 'show', 'attrmap_x', 'ft_html', 'ft_hx', 'File',
7
+ 'fill_form', 'fill_dataclass', 'find_inputs', 'html2ft', 'sse_message', 'A', 'Abbr', 'Address', 'Area',
8
+ 'Article', 'Aside', 'Audio', 'B', 'Base', 'Bdi', 'Bdo', 'Blockquote', 'Body', 'Br', 'Button', 'Canvas',
9
+ 'Caption', 'Cite', 'Code', 'Col', 'Colgroup', 'Data', 'Datalist', 'Dd', 'Del', 'Details', 'Dfn', 'Dialog',
10
+ 'Div', 'Dl', 'Dt', 'Em', 'Embed', 'Fencedframe', 'Fieldset', 'Figcaption', 'Figure', 'Footer', 'Form', 'H1',
11
+ 'H2', 'H3', 'H4', 'H5', 'H6', 'Head', 'Header', 'Hgroup', 'Hr', 'Html', 'I', 'Iframe', 'Img', 'Input', 'Ins',
12
+ 'Kbd', 'Label', 'Legend', 'Li', 'Link', 'Main', 'Map', 'Mark', 'Menu', 'Meta', 'Meter', 'Nav', 'Noscript',
13
+ 'Object', 'Ol', 'Optgroup', 'Option', 'Output', 'P', 'Picture', 'PortalExperimental', 'Pre', 'Progress', 'Q',
14
+ 'Rp', 'Rt', 'Ruby', 'S', 'Samp', 'Script', 'Search', 'Section', 'Select', 'Slot', 'Small', 'Source', 'Span',
15
+ 'Strong', 'Style', 'Sub', 'Summary', 'Sup', 'Table', 'Tbody', 'Td', 'Template', 'Textarea', 'Tfoot', 'Th',
16
+ 'Thead', 'Time', 'Title', 'Tr', 'Track', 'U', 'Ul', 'Var', 'Video', 'Wbr']
17
17
 
18
18
  # %% ../nbs/api/01_components.ipynb
19
19
  from dataclasses import dataclass, asdict, is_dataclass, make_dataclass, replace, astuple, MISSING
20
20
  from bs4 import BeautifulSoup, Comment
21
+ from typing import Literal, Optional
21
22
 
22
23
  from fastcore.utils import *
23
24
  from fastcore.xml import *
@@ -40,7 +41,21 @@ def show(ft,*rest):
40
41
  named = set('a button form frame iframe img input map meta object param select textarea'.split())
41
42
  html_attrs = 'id cls title style accesskey contenteditable dir draggable enterkeyhint hidden inert inputmode lang popover spellcheck tabindex translate'.split()
42
43
  hx_attrs = 'get post put delete patch trigger target swap swap_oob include select select_oob indicator push_url confirm disable replace_url vals disabled_elt ext headers history history_elt indicator inherit params preserve prompt replace_url request sync validate'
43
- hx_attrs = html_attrs + [f'hx_{o}' for o in hx_attrs.split()]
44
+ hx_attrs = [f'hx_{o}' for o in hx_attrs.split()]
45
+ hx_attrs_annotations = {
46
+ "hx_swap": Literal["innerHTML", "outerHTML", "afterbegin", "beforebegin", "beforeend", "afterend", "delete", "none"] | str,
47
+ "hx_swap_oob": Literal["true", "innerHTML", "outerHTML", "afterbegin", "beforebegin", "beforeend", "afterend", "delete", "none"] | str,
48
+ "hx_push_url": Literal["true", "false"] | str,
49
+ "hx_replace_url": Literal["true", "false"] | str,
50
+ "hx_disabled_elt": Literal["this", "next", "previous"] | str,
51
+ "hx_history": Literal["false"] | str,
52
+ "hx_params": Literal["*", "none"] | str,
53
+ "hx_replace_url": Literal["true", "false"] | str,
54
+ "hx_validate": Literal["true", "false"],
55
+ }
56
+ hx_attrs_annotations |= {o: str for o in set(hx_attrs) - set(hx_attrs_annotations.keys())}
57
+ hx_attrs_annotations = {k: Optional[v] for k,v in hx_attrs_annotations.items()}
58
+ hx_attrs = html_attrs + hx_attrs
44
59
 
45
60
  # %% ../nbs/api/01_components.ipynb
46
61
  def attrmap_x(o):