python-fasthtml 0.12.24__tar.gz → 0.12.26__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.12.24/python_fasthtml.egg-info → python_fasthtml-0.12.26}/PKG-INFO +1 -1
  2. python_fasthtml-0.12.26/fasthtml/__init__.py +2 -0
  3. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/core.py +8 -9
  4. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26/python_fasthtml.egg-info}/PKG-INFO +1 -1
  5. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/settings.ini +1 -1
  6. python_fasthtml-0.12.24/fasthtml/__init__.py +0 -2
  7. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/CONTRIBUTING.md +0 -0
  8. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/LICENSE +0 -0
  9. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/MANIFEST.in +0 -0
  10. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/README.md +0 -0
  11. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/_modidx.py +0 -0
  12. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/authmw.py +0 -0
  13. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/basics.py +0 -0
  14. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/cli.py +0 -0
  15. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/common.py +0 -0
  16. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/components.py +0 -0
  17. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/components.pyi +0 -0
  18. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/core.pyi +0 -0
  19. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/fastapp.py +0 -0
  20. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/ft.py +0 -0
  21. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/js.py +0 -0
  22. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/jupyter.py +0 -0
  23. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/katex.js +0 -0
  24. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/live_reload.py +0 -0
  25. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/oauth.py +0 -0
  26. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/pico.py +0 -0
  27. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/starlette.py +0 -0
  28. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/stripe_otp.py +0 -0
  29. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/svg.py +0 -0
  30. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/toaster.py +0 -0
  31. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/xtend.py +0 -0
  32. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/fasthtml/xtend.pyi +0 -0
  33. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/pyproject.toml +0 -0
  34. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/python_fasthtml.egg-info/SOURCES.txt +0 -0
  35. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/python_fasthtml.egg-info/dependency_links.txt +0 -0
  36. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/python_fasthtml.egg-info/entry_points.txt +0 -0
  37. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/python_fasthtml.egg-info/not-zip-safe +0 -0
  38. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/python_fasthtml.egg-info/requires.txt +0 -0
  39. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/python_fasthtml.egg-info/top_level.txt +0 -0
  40. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/setup.cfg +0 -0
  41. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/setup.py +0 -0
  42. {python_fasthtml-0.12.24 → python_fasthtml-0.12.26}/tests/test_toaster.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fasthtml
3
- Version: 0.12.24
3
+ Version: 0.12.26
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 and contributors
@@ -0,0 +1,2 @@
1
+ __version__ = "0.12.26"
2
+ from .core import *
@@ -213,7 +213,7 @@ async def _find_p(req, arg:str, p:Parameter):
213
213
  except ValueError: raise HTTPException(404, req.url.path) from None
214
214
 
215
215
  async def _wrap_req(req, params):
216
- return [await _find_p(req, arg, p) for arg,p in params.items()]
216
+ return {arg:await _find_p(req, arg, p) for arg,p in params.items()}
217
217
 
218
218
  # %% ../nbs/api/00_core.ipynb
219
219
  def flat_xt(lst):
@@ -230,7 +230,7 @@ class Beforeware:
230
230
  def __init__(self, f, skip=None): self.f,self.skip = f,skip or []
231
231
 
232
232
  # %% ../nbs/api/00_core.ipynb
233
- async def _handle(f, args, **kwargs):
233
+ async def _handle(f, *args, **kwargs):
234
234
  return (await f(*args, **kwargs)) if is_async_callable(f) else await run_in_threadpool(f, *args, **kwargs)
235
235
 
236
236
  # %% ../nbs/api/00_core.ipynb
@@ -260,12 +260,11 @@ def _find_wsp(ws, data, hdrs, arg:str, p:Parameter):
260
260
 
261
261
  def _wrap_ws(ws, data, params):
262
262
  hdrs = {k.lower().replace('-','_'):v for k,v in data.pop('HEADERS', {}).items()}
263
- return [_find_wsp(ws, data, hdrs, arg, p) for arg,p in params.items()]
263
+ return {arg:_find_wsp(ws, data, hdrs, arg, p) for arg,p in params.items()}
264
264
 
265
265
  # %% ../nbs/api/00_core.ipynb
266
266
  async def _send_ws(ws, resp):
267
267
  if not resp: return
268
- # res = to_xml(resp, indent=fh_cfg.indent) if isinstance(resp, (list,tuple,FT)) or hasattr(resp, '__ft__') else resp
269
268
  res = to_xml(resp, indent=fh_cfg.indent)
270
269
  await ws.send_text(res)
271
270
 
@@ -274,7 +273,7 @@ def _ws_endp(recv, conn=None, disconn=None):
274
273
 
275
274
  async def _generic_handler(handler, ws, data=None):
276
275
  wd = _wrap_ws(ws, loads(data) if data else {}, _params(handler))
277
- resp = await _handle(handler, wd)
276
+ resp = await _handle(handler, **wd)
278
277
  if resp: await _send_ws(ws, resp)
279
278
 
280
279
  async def _connect(self, ws):
@@ -469,7 +468,7 @@ class Redirect:
469
468
  async def _wrap_call(f, req, params):
470
469
  "Wrap function call with request parameter injection"
471
470
  wreq = await _wrap_req(req, params)
472
- return await _handle(f, wreq)
471
+ return await _handle(f, **wreq)
473
472
 
474
473
  # %% ../nbs/api/00_core.ipynb
475
474
  htmx_exts = {
@@ -514,7 +513,7 @@ def _wrap_ex(f, status_code, hdrs, ftrs, htmlkw, bodykw, body_wrap):
514
513
  async def _f(req, exc):
515
514
  req.hdrs,req.ftrs,req.htmlkw,req.bodykw = map(deepcopy, (hdrs, ftrs, htmlkw, bodykw))
516
515
  req.body_wrap = body_wrap
517
- res = await _handle(f, (req, exc))
516
+ res = await _handle(f, req, exc)
518
517
  return _resp(req, res, status_code=status_code)
519
518
  return _f
520
519
 
@@ -620,8 +619,8 @@ def _endp(self:FastHTML, f, body_wrap):
620
619
  req.body_wrap = body_wrap
621
620
  if not resp: resp = await _wrap_call(f, req, sig.parameters)
622
621
  for a in self.after:
623
- _,*wreq = await _wrap_req(req, _params(a))
624
- nr = a(resp, *wreq)
622
+ wreq = await _wrap_req(req, _params(a))
623
+ nr = a(**wreq)
625
624
  if nr: resp = nr
626
625
  return _resp(req, resp, sig.return_annotation)
627
626
  return _f
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fasthtml
3
- Version: 0.12.24
3
+ Version: 0.12.26
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 and contributors
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = fasthtml
3
3
  lib_name = python-fasthtml
4
- version = 0.12.24
4
+ version = 0.12.26
5
5
  min_python = 3.10
6
6
  license = apache2
7
7
  requirements = fastcore>=1.8.1 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.1.1 python-multipart beautifulsoup4
@@ -1,2 +0,0 @@
1
- __version__ = "0.12.24"
2
- from .core import *