python-fasthtml 0.12.50__tar.gz → 0.13.0__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.12.50/python_fasthtml.egg-info → python_fasthtml-0.13.0}/PKG-INFO +2 -2
- python_fasthtml-0.13.0/fasthtml/__init__.py +2 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/_modidx.py +1 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/core.py +22 -10
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/pyproject.toml +1 -1
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0/python_fasthtml.egg-info}/PKG-INFO +2 -2
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/requires.txt +1 -1
- python_fasthtml-0.12.50/fasthtml/__init__.py +0 -2
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/CONTRIBUTING.md +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/LICENSE +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/MANIFEST.in +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/README.md +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/authmw.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/basics.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/cli.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/common.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/components.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/components.pyi +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/core.pyi +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/fastapp.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/ft.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/js.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/jupyter.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/katex.js +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/live_reload.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/oauth.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/pico.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/starlette.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/stripe_otp.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/svg.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/toaster.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/xtend.py +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/fasthtml/xtend.pyi +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/SOURCES.txt +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/dependency_links.txt +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/entry_points.txt +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/top_level.txt +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/setup.cfg +0 -0
- {python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/tests/test_toaster.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-fasthtml
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
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
|
|
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: fastcore>=1.12.16
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
|
-
Requires-Dist: starlette
|
|
20
|
+
Requires-Dist: starlette~=1.0
|
|
21
21
|
Requires-Dist: oauthlib
|
|
22
22
|
Requires-Dist: itsdangerous
|
|
23
23
|
Requires-Dist: uvicorn[standard]>=0.30
|
|
@@ -104,6 +104,7 @@ d = { 'settings': { 'branch': 'main',
|
|
|
104
104
|
'fasthtml.core._is_body': ('api/core.html#_is_body', 'fasthtml/core.py'),
|
|
105
105
|
'fasthtml.core._is_ft_resp': ('api/core.html#_is_ft_resp', 'fasthtml/core.py'),
|
|
106
106
|
'fasthtml.core._list': ('api/core.html#_list', 'fasthtml/core.py'),
|
|
107
|
+
'fasthtml.core._mk_lifespan': ('api/core.html#_mk_lifespan', 'fasthtml/core.py'),
|
|
107
108
|
'fasthtml.core._mk_list': ('api/core.html#_mk_list', 'fasthtml/core.py'),
|
|
108
109
|
'fasthtml.core._mk_locfunc': ('api/core.html#_mk_locfunc', 'fasthtml/core.py'),
|
|
109
110
|
'fasthtml.core._params': ('api/core.html#_params', 'fasthtml/core.py'),
|
|
@@ -12,7 +12,7 @@ __all__ = ['empty', 'htmx_hdrs', 'fh_cfg', 'htmx_resps', 'htmx_exts', 'htmxsrc',
|
|
|
12
12
|
'FtResponse', 'unqid']
|
|
13
13
|
|
|
14
14
|
# %% ../nbs/api/00_core.ipynb #23503b9e
|
|
15
|
-
import json,uuid,inspect,types,
|
|
15
|
+
import json,uuid,inspect,types,asyncio,inspect,random,contextlib,httpx,itsdangerous,uvicorn
|
|
16
16
|
|
|
17
17
|
from fastcore.utils import *
|
|
18
18
|
from fastcore.xml import *
|
|
@@ -20,20 +20,20 @@ from fastcore.meta import use_kwargs_dict,delegates
|
|
|
20
20
|
from fastcore.style import S
|
|
21
21
|
|
|
22
22
|
from types import UnionType, SimpleNamespace as ns, GenericAlias
|
|
23
|
-
from typing import
|
|
23
|
+
from typing import get_args, get_origin, Union, Mapping, List, Any
|
|
24
24
|
from datetime import datetime,date
|
|
25
|
-
from dataclasses import dataclass
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from functools import wraps, partialmethod, update_wrapper
|
|
25
|
+
from dataclasses import dataclass
|
|
26
|
+
from inspect import Parameter,get_annotations
|
|
27
|
+
from functools import partialmethod, update_wrapper
|
|
29
28
|
from http import cookies
|
|
30
29
|
from urllib.parse import urlencode, parse_qs, quote, unquote
|
|
31
|
-
from copy import
|
|
30
|
+
from copy import deepcopy
|
|
32
31
|
from warnings import warn
|
|
33
32
|
from dateutil import parser as dtparse
|
|
34
33
|
from anyio import from_thread
|
|
35
34
|
from uuid import uuid4, UUID
|
|
36
|
-
from base64 import
|
|
35
|
+
from base64 import b64encode
|
|
36
|
+
from email.utils import format_datetime
|
|
37
37
|
|
|
38
38
|
from .starlette import *
|
|
39
39
|
|
|
@@ -566,6 +566,18 @@ iframe_scr = Script(NotStr("""
|
|
|
566
566
|
document.body.addEventListener('htmx:wsAfterMessage', sendmsg);
|
|
567
567
|
};"""))
|
|
568
568
|
|
|
569
|
+
# %% ../nbs/api/00_core.ipynb #d370ef59
|
|
570
|
+
def _mk_lifespan(ls, on_startup, on_shutdown):
|
|
571
|
+
if not on_startup and not on_shutdown: return ls
|
|
572
|
+
@contextlib.asynccontextmanager
|
|
573
|
+
async def _ls(app):
|
|
574
|
+
for f in listify(on_startup): await _handle(f)
|
|
575
|
+
if ls:
|
|
576
|
+
async with ls(app): yield
|
|
577
|
+
else: yield
|
|
578
|
+
for f in listify(on_shutdown): await _handle(f)
|
|
579
|
+
return _ls
|
|
580
|
+
|
|
569
581
|
# %% ../nbs/api/00_core.ipynb #3327a1e9
|
|
570
582
|
class FastHTML(Starlette):
|
|
571
583
|
def __init__(self, debug=False, routes=None, middleware=None, title: str = "FastHTML page", exception_handlers=None,
|
|
@@ -586,7 +598,7 @@ class FastHTML(Starlette):
|
|
|
586
598
|
from IPython.display import display,HTML
|
|
587
599
|
if nb_hdrs: display(HTML(to_xml(tuple(hdrs))))
|
|
588
600
|
middleware.append(cors_allow)
|
|
589
|
-
|
|
601
|
+
lifespan = _mk_lifespan(lifespan, on_startup, on_shutdown)
|
|
590
602
|
self.lifespan,self.hdrs,self.ftrs = lifespan,hdrs,ftrs
|
|
591
603
|
self.body_wrap,self.before,self.after,self.htmlkw,self.bodykw = body_wrap,before,after,htmlkw,bodykw
|
|
592
604
|
self.secret_key = get_key(secret_key, key_fname)
|
|
@@ -600,7 +612,7 @@ class FastHTML(Starlette):
|
|
|
600
612
|
def _not_found(req, exc): return Response('404 Not Found', status_code=404)
|
|
601
613
|
exception_handlers[404] = _not_found
|
|
602
614
|
excs = {k:_wrap_ex(v, k, hdrs, ftrs, htmlkw, bodykw, body_wrap=body_wrap) for k,v in exception_handlers.items()}
|
|
603
|
-
super().__init__(debug, routes, middleware=middleware, exception_handlers=excs,
|
|
615
|
+
super().__init__(debug, routes, middleware=middleware, exception_handlers=excs, lifespan=lifespan)
|
|
604
616
|
|
|
605
617
|
# %% ../nbs/api/00_core.ipynb #dce68049
|
|
606
618
|
class HostRoute(Route):
|
|
@@ -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
|
|
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']
|
|
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.
|
|
3
|
+
Version: 0.13.0
|
|
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
|
|
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: fastcore>=1.12.16
|
|
19
19
|
Requires-Dist: python-dateutil
|
|
20
|
-
Requires-Dist: starlette
|
|
20
|
+
Requires-Dist: starlette~=1.0
|
|
21
21
|
Requires-Dist: oauthlib
|
|
22
22
|
Requires-Dist: itsdangerous
|
|
23
23
|
Requires-Dist: uvicorn[standard]>=0.30
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{python_fasthtml-0.12.50 → python_fasthtml-0.13.0}/python_fasthtml.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|