python-fasthtml 0.6.12__tar.gz → 0.6.13__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 (41) hide show
  1. {python-fasthtml-0.6.12/python_fasthtml.egg-info → python-fasthtml-0.6.13}/PKG-INFO +1 -1
  2. python-fasthtml-0.6.13/fasthtml/__init__.py +2 -0
  3. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/components.py +1 -1
  4. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/core.py +4 -2
  5. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/svg.py +2 -2
  6. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13/python_fasthtml.egg-info}/PKG-INFO +1 -1
  7. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/settings.ini +1 -1
  8. python-fasthtml-0.6.12/fasthtml/__init__.py +0 -2
  9. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/CONTRIBUTING.md +0 -0
  10. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/LICENSE +0 -0
  11. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/MANIFEST.in +0 -0
  12. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/README.md +0 -0
  13. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/_modidx.py +0 -0
  14. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/authmw.py +0 -0
  15. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/basics.py +0 -0
  16. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/cli.py +0 -0
  17. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/common.py +0 -0
  18. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/components.pyi +0 -0
  19. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/core.pyi +0 -0
  20. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/fastapp.py +0 -0
  21. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/ft.py +0 -0
  22. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/js.py +0 -0
  23. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/jupyter.py +0 -0
  24. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/katex.js +0 -0
  25. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/live_reload.py +0 -0
  26. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/oauth.py +0 -0
  27. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/pico.py +0 -0
  28. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/starlette.py +0 -0
  29. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/toaster.py +0 -0
  30. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/xtend.py +0 -0
  31. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/fasthtml/xtend.pyi +0 -0
  32. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/pyproject.toml +0 -0
  33. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/SOURCES.txt +0 -0
  34. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/dependency_links.txt +0 -0
  35. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/entry_points.txt +0 -0
  36. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/not-zip-safe +0 -0
  37. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/requires.txt +0 -0
  38. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/python_fasthtml.egg-info/top_level.txt +0 -0
  39. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/setup.cfg +0 -0
  40. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/setup.py +0 -0
  41. {python-fasthtml-0.6.12 → python-fasthtml-0.6.13}/tests/test_toaster.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-fasthtml
3
- Version: 0.6.12
3
+ Version: 0.6.13
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.13"
2
+ from .core import *
@@ -24,7 +24,7 @@ from fastcore.utils import *
24
24
  from fastcore.xml import *
25
25
  from fastcore.meta import use_kwargs, delegates
26
26
  from fastcore.test import *
27
- from .core import fh_cfg
27
+ from .core import fh_cfg, unqid
28
28
 
29
29
  import types, json
30
30
 
@@ -175,6 +175,7 @@ async def _find_p(req, arg:str, p:Parameter):
175
175
  if anno is empty:
176
176
  if 'request'.startswith(arg.lower()): return req
177
177
  if 'session'.startswith(arg.lower()): return req.scope.get('session', {})
178
+ if arg.lower()=='scope': return dict2obj(req.scope)
178
179
  if arg.lower()=='auth': return req.scope.get('auth', None)
179
180
  if arg.lower()=='htmx': return _get_htmx(req.headers)
180
181
  if arg.lower()=='app': return req.scope['app']
@@ -229,6 +230,7 @@ def _find_wsp(ws, data, hdrs, arg:str, p:Parameter):
229
230
  if issubclass(anno, Starlette): return ws.scope['app']
230
231
  if anno is empty:
231
232
  if arg.lower()=='ws': return ws
233
+ if arg.lower()=='scope': return dict2obj(ws.scope)
232
234
  if arg.lower()=='data': return data
233
235
  if arg.lower()=='htmx': return _get_htmx(hdrs)
234
236
  if arg.lower()=='app': return ws.scope['app']
@@ -554,8 +556,8 @@ class FastHTML(Starlette):
554
556
 
555
557
  def ws(self, path:str, conn=None, disconn=None, name=None):
556
558
  "Add a websocket route at `path`"
557
- def f(func):
558
- self.router.add_ws(path, func, conn=conn, disconn=disconn, name=name)
559
+ def f(func=None):
560
+ self.router.add_ws(path, func or noop, conn=conn, disconn=disconn, name=name)
559
561
  return func
560
562
  return f
561
563
 
@@ -31,12 +31,12 @@ g = globals()
31
31
  for o in _all_: g[o] = partial(ft_hx, o[0].lower() + o[1:])
32
32
 
33
33
  # %% ../nbs/api/05_svg.ipynb
34
- def Svg(*args, viewBox=None, h=None, w=None, height=None, width=None, **kwargs):
34
+ def Svg(*args, viewBox=None, h=None, w=None, height=None, width=None, xmlns="http://www.w3.org/2000/svg", **kwargs):
35
35
  "An SVG tag; xmlns is added automatically, and viewBox defaults to height and width if not provided"
36
36
  if h: height=h
37
37
  if w: width=w
38
38
  if not viewBox and height and width: viewBox=f'0 0 {width} {height}'
39
- return ft_svg('svg', *args, xmlns="http://www.w3.org/2000/svg", viewBox=viewBox, height=height, width=width, **kwargs)
39
+ return ft_svg('svg', *args, xmlns=xmlns, viewBox=viewBox, height=height, width=width, **kwargs)
40
40
 
41
41
  # %% ../nbs/api/05_svg.ipynb
42
42
  @delegates(ft_hx)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-fasthtml
3
- Version: 0.6.12
3
+ Version: 0.6.13
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
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = fasthtml
3
3
  lib_name = fasthtml
4
- version = 0.6.12
4
+ version = 0.6.13
5
5
  min_python = 3.10
6
6
  license = apache2
7
7
  requirements = fastcore>=1.7.15 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.0.9 python-multipart beautifulsoup4
@@ -1,2 +0,0 @@
1
- __version__ = "0.6.12"
2
- from .core import *