python-fasthtml 0.13.3__tar.gz → 0.13.4__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 (39) hide show
  1. {python_fasthtml-0.13.3/python_fasthtml.egg-info → python_fasthtml-0.13.4}/PKG-INFO +2 -2
  2. python_fasthtml-0.13.4/fasthtml/__init__.py +2 -0
  3. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/_modidx.py +0 -1
  4. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/core.py +5 -11
  5. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/pyproject.toml +1 -1
  6. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4/python_fasthtml.egg-info}/PKG-INFO +2 -2
  7. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/python_fasthtml.egg-info/requires.txt +1 -1
  8. python_fasthtml-0.13.3/fasthtml/__init__.py +0 -2
  9. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/CONTRIBUTING.md +0 -0
  10. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/LICENSE +0 -0
  11. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/MANIFEST.in +0 -0
  12. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/README.md +0 -0
  13. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/authmw.py +0 -0
  14. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/basics.py +0 -0
  15. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/cli.py +0 -0
  16. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/common.py +0 -0
  17. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/components.py +0 -0
  18. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/components.pyi +0 -0
  19. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/core.pyi +0 -0
  20. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/fastapp.py +0 -0
  21. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/ft.py +0 -0
  22. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/js.py +0 -0
  23. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/jupyter.py +0 -0
  24. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/katex.js +0 -0
  25. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/live_reload.py +0 -0
  26. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/oauth.py +0 -0
  27. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/pico.py +0 -0
  28. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/starlette.py +0 -0
  29. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/stripe_otp.py +0 -0
  30. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/svg.py +0 -0
  31. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/toaster.py +0 -0
  32. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/xtend.py +0 -0
  33. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/fasthtml/xtend.pyi +0 -0
  34. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/python_fasthtml.egg-info/SOURCES.txt +0 -0
  35. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/python_fasthtml.egg-info/dependency_links.txt +0 -0
  36. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/python_fasthtml.egg-info/entry_points.txt +0 -0
  37. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/python_fasthtml.egg-info/top_level.txt +0 -0
  38. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/setup.cfg +0 -0
  39. {python_fasthtml-0.13.3 → python_fasthtml-0.13.4}/tests/test_toaster.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fasthtml
3
- Version: 0.13.3
3
+ Version: 0.13.4
4
4
  Summary: The fastest way to create an HTML app
5
5
  Author-email: Jeremy Howard and contributors <github@jhoward.fastmail.fm>
6
6
  License: Apache-2.0
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: fastcore>=1.12.16
18
+ Requires-Dist: fastcore>=1.12.41
19
19
  Requires-Dist: python-dateutil
20
20
  Requires-Dist: starlette~=1.0
21
21
  Requires-Dist: oauthlib
@@ -0,0 +1,2 @@
1
+ __version__ = "0.13.4"
2
+ from .core import *
@@ -104,7 +104,6 @@ d = { 'settings': { 'branch': 'main',
104
104
  'fasthtml.core._LifespanCtx.__init__': ('api/core.html#_lifespanctx.__init__', 'fasthtml/core.py'),
105
105
  'fasthtml.core._add_ids': ('api/core.html#_add_ids', 'fasthtml/core.py'),
106
106
  'fasthtml.core._annotations': ('api/core.html#_annotations', 'fasthtml/core.py'),
107
- 'fasthtml.core._apply_ft': ('api/core.html#_apply_ft', 'fasthtml/core.py'),
108
107
  'fasthtml.core._canonical': ('api/core.html#_canonical', 'fasthtml/core.py'),
109
108
  'fasthtml.core._check_anno': ('api/core.html#_check_anno', 'fasthtml/core.py'),
110
109
  'fasthtml.core._find_p': ('api/core.html#_find_p', 'fasthtml/core.py'),
@@ -187,10 +187,12 @@ class ApiReturn:
187
187
  # %% ../nbs/api/00_core.ipynb #7cc39ba9
188
188
  class JSONResponse(JSONResponseOrig):
189
189
  "Same as starlette's version, but auto-stringifies non serializable types"
190
- def render(self, content: Any) -> bytes:
191
- res = json.dumps(content, ensure_ascii=False, allow_nan=False, indent=None, separators=(",", ":"), default=str)
190
+ def render(self, content:Any)->bytes:
191
+ def _default(o): return list(o) if is_listy(o) else str(o)
192
+ res = json.dumps(content, ensure_ascii=False, allow_nan=False, indent=None, separators=(",",":"), default=_default)
192
193
  return res.encode("utf-8")
193
194
 
195
+
194
196
  # %% ../nbs/api/00_core.ipynb #5fa96e3a
195
197
  async def _find_p(conn, data, hdrs, arg:str, p:Parameter):
196
198
  "In `data` find param named `arg` of type in `p` (`arg` is ignored for body types)"
@@ -210,7 +212,7 @@ async def _find_p(conn, data, hdrs, arg:str, p:Parameter):
210
212
  if anno is empty:
211
213
  if arg.lower()=='ws' or 'request'.startswith(arg.lower()): return conn
212
214
  if 'session'.startswith(arg.lower()): return conn.scope.get('session', {})
213
- if arg.lower()=='scope': return dict2obj(conn.scope)
215
+ if arg.lower()=='scope': return conn.scope
214
216
  if arg.lower()=='data': return data
215
217
  if arg.lower()=='htmx': return _get_htmx(hdrs)
216
218
  if arg.lower()=='app': return conn.scope['app']
@@ -369,16 +371,8 @@ def _find_targets(req, resp):
369
371
  t = resp.attrs.pop(k, None)
370
372
  if t: resp.attrs[v] = _url_for(req, t)
371
373
 
372
- def _apply_ft(o):
373
- "Apply FastTag transformation recursively to object `o`"
374
- if isinstance(o, tuple): o = tuple(_apply_ft(c) for c in o)
375
- if hasattr(o, '__ft__'): o = o.__ft__()
376
- if isinstance(o, FT): o.children = tuple(_apply_ft(c) for c in o.children)
377
- return o
378
-
379
374
  def _to_xml(req, resp, indent):
380
375
  "Convert response to XML string with target URL resolution"
381
- resp = _apply_ft(resp)
382
376
  _find_targets(req, resp)
383
377
  return to_xml(resp, indent=indent)
384
378
 
@@ -12,7 +12,7 @@ license = {text = "Apache-2.0"}
12
12
  authors = [{name = "Jeremy Howard and contributors", email = "github@jhoward.fastmail.fm"}]
13
13
  keywords = ['nbdev', 'jupyter', 'notebook', 'python']
14
14
  classifiers = ["Natural Language :: English", "Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only"]
15
- dependencies = ['fastcore>=1.12.16', 'python-dateutil', 'starlette~=1.0', 'oauthlib', 'itsdangerous', 'uvicorn[standard]>=0.30', 'httpx', 'fastlite>=0.1.1', 'python-multipart', 'beautifulsoup4']
15
+ dependencies = ['fastcore>=1.12.41', 'python-dateutil', 'starlette~=1.0', 'oauthlib', 'itsdangerous', 'uvicorn[standard]>=0.30', 'httpx', 'fastlite>=0.1.1', 'python-multipart', 'beautifulsoup4']
16
16
 
17
17
  [project.urls]
18
18
  Repository = "https://github.com/AnswerDotAI/fasthtml"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-fasthtml
3
- Version: 0.13.3
3
+ Version: 0.13.4
4
4
  Summary: The fastest way to create an HTML app
5
5
  Author-email: Jeremy Howard and contributors <github@jhoward.fastmail.fm>
6
6
  License: Apache-2.0
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: fastcore>=1.12.16
18
+ Requires-Dist: fastcore>=1.12.41
19
19
  Requires-Dist: python-dateutil
20
20
  Requires-Dist: starlette~=1.0
21
21
  Requires-Dist: oauthlib
@@ -1,4 +1,4 @@
1
- fastcore>=1.12.16
1
+ fastcore>=1.12.41
2
2
  python-dateutil
3
3
  starlette~=1.0
4
4
  oauthlib
@@ -1,2 +0,0 @@
1
- __version__ = "0.13.3"
2
- from .core import *