python-fasthtml 0.2.0__tar.gz → 0.2.1__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 (36) hide show
  1. python-fasthtml-0.2.1/PKG-INFO +146 -0
  2. python-fasthtml-0.2.1/README.md +115 -0
  3. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/__init__.py +1 -1
  4. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/cli.py +2 -1
  5. python-fasthtml-0.2.1/python_fasthtml.egg-info/PKG-INFO +146 -0
  6. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/settings.ini +1 -1
  7. python-fasthtml-0.2.0/PKG-INFO +0 -383
  8. python-fasthtml-0.2.0/README.md +0 -352
  9. python-fasthtml-0.2.0/python_fasthtml.egg-info/PKG-INFO +0 -383
  10. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/CONTRIBUTING.md +0 -0
  11. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/LICENSE +0 -0
  12. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/MANIFEST.in +0 -0
  13. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/_modidx.py +0 -0
  14. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/authmw.py +0 -0
  15. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/common.py +0 -0
  16. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/components.py +0 -0
  17. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/components.pyi +0 -0
  18. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/core.py +0 -0
  19. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/fastapp.py +0 -0
  20. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/ft.py +0 -0
  21. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/js.py +0 -0
  22. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/live_reload.py +0 -0
  23. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/oauth.py +0 -0
  24. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/starlette.py +0 -0
  25. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/svg.py +0 -0
  26. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/toaster.py +0 -0
  27. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/xtend.py +0 -0
  28. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/fasthtml/xtend.pyi +0 -0
  29. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/python_fasthtml.egg-info/SOURCES.txt +0 -0
  30. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/python_fasthtml.egg-info/dependency_links.txt +0 -0
  31. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/python_fasthtml.egg-info/entry_points.txt +0 -0
  32. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/python_fasthtml.egg-info/not-zip-safe +0 -0
  33. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/python_fasthtml.egg-info/requires.txt +0 -0
  34. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/python_fasthtml.egg-info/top_level.txt +0 -0
  35. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/setup.cfg +0 -0
  36. {python-fasthtml-0.2.0 → python-fasthtml-0.2.1}/setup.py +0 -0
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.1
2
+ Name: python-fasthtml
3
+ Version: 0.2.1
4
+ Summary: The fastest way to create an HTML app
5
+ Home-page: https://github.com/AnswerDotAI/fasthtml
6
+ Author: Jeremy Howard
7
+ Author-email: github@jhoward.fastmail.fm
8
+ License: Apache Software License 2.0
9
+ Keywords: nbdev jupyter notebook python
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: fastcore>=1.6.0
19
+ Requires-Dist: python-dateutil
20
+ Requires-Dist: starlette>0.33
21
+ Requires-Dist: oauthlib
22
+ Requires-Dist: itsdangerous
23
+ Requires-Dist: uvicorn[standard]>=0.30
24
+ Requires-Dist: httpx
25
+ Requires-Dist: fastlite>=0.0.6
26
+ Requires-Dist: python-multipart
27
+ Requires-Dist: beautifulsoup4
28
+ Provides-Extra: dev
29
+ Requires-Dist: ipython; extra == "dev"
30
+ Requires-Dist: lxml; extra == "dev"
31
+
32
+ # FastHTML
33
+
34
+
35
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
36
+
37
+ Welcome to the official FastHTML documentation.
38
+
39
+ FastHTML is a new next-generation web framework for fast, scalable web
40
+ applications with minimal, compact code. It’s designed to be:
41
+
42
+ - Powerful and expressive enough to build the most advanced, interactive
43
+ web apps you can imagine.
44
+ - Fast and lightweight, so you can write less code and get more done.
45
+ - Easy to learn and use, with a simple, intuitive syntax that makes it
46
+ easy to build complex apps quickly.
47
+
48
+ FastHTML apps are just Python code, so you can use FastHTML with the
49
+ full power of the Python language and ecosystem.
50
+
51
+ ## Installation
52
+
53
+ Since `fasthtml` is a Python library, you can install it with:
54
+
55
+ ``` sh
56
+ pip install python-fasthtml
57
+ ```
58
+
59
+ In the near future, we hope to add component libraries that can likewise
60
+ be installed via `pip`.
61
+
62
+ ## Usage
63
+
64
+ For a minimal app, create a file “main.py” as follows:
65
+
66
+ <div class="code-with-filename">
67
+
68
+ **main.py**
69
+
70
+ ``` python
71
+ from fasthtml.common import *
72
+
73
+ app,rt = fast_app()
74
+
75
+ @rt('/')
76
+ def get(): return Div(P('Hello World!'), hx_get="/change")
77
+
78
+ serve()
79
+ ```
80
+
81
+ </div>
82
+
83
+ Running the app with `python main.py` prints out a link to your running
84
+ app: `http://localhost:5001/`. Visit that link in your browser and you
85
+ should see a page with the title “FastHTML” and the text “Let’s do
86
+ this!”. Congratulations - you’ve just created your first `fasthtml` app!
87
+
88
+ Adding interactivity is surprisingly easy, thanks to HTMX. If you modify
89
+ the file to add this function…:
90
+
91
+ <div class="code-with-filename">
92
+
93
+ **main.py**
94
+
95
+ ``` python
96
+ @rt('/change')
97
+ def get(): return P('Nice to be here!')
98
+ ```
99
+
100
+ </div>
101
+
102
+ …you’ll now have a page with a clickable element that changes the text
103
+ when clicked. When clicking on this link, the server will respond with
104
+ an “HTML partial”—that is, just a snippet of HTML which will be inserted
105
+ into the existing page. In this case, the returned element will replace
106
+ the original P element (since that’s the default behavior of HTMX) with
107
+ the new version returned by the second route.
108
+
109
+ This “hypermedia-based” approach to web development is a powerful way to
110
+ build web applications.
111
+
112
+ ## Next Steps
113
+
114
+ Start with the official sources to learn more about FastHTML:
115
+
116
+ - [About](https://about.fastht.ml): Learn about the core ideas behind
117
+ FastHTML
118
+ - [Documentation](https://docs.fastht.ml): Learn from examples how to
119
+ write FastHTML code
120
+ - [Idiomatic
121
+ app](https://github.com/AnswerDotAI/fasthtml/blob/main/examples/adv_app.py):
122
+ Heavily commented source code walking through a complete application,
123
+ including custom authentication, JS library connections, and database
124
+ use.
125
+
126
+ The capabilities of FastHTML are vast and growing, and not all the
127
+ features and patterns have been documented yet. Be prepared to invest
128
+ time into studying and modifying source code, such as the main FastHTML
129
+ repo’s notebooks and the official FastHTML examples repo:
130
+
131
+ - [FastHTML Examples Repo on
132
+ GitHub](https://github.com/AnswerDotAI/fasthtml-example)
133
+ - [FastHTML Repo on GitHub](https://github.com/AnswerDotAI/fasthtml)
134
+
135
+ Then explore the small but growing third-party ecosystem of FastHTML
136
+ tutorials, notebooks, libraries, and components:
137
+
138
+ - [Creating Custom FastHTML Tags for Markdown
139
+ Rendering](https://isaac-flath.github.io/website/posts/boots/FasthtmlTutorial.html)
140
+ by Isaac Flath
141
+ - Your tutorial here!
142
+
143
+ Finally, join the FastHTML community to ask questions, share your work,
144
+ and learn from others:
145
+
146
+ - [Discord](https://discord.gg/qcXvcxMhdP)
@@ -0,0 +1,115 @@
1
+ # FastHTML
2
+
3
+
4
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
5
+
6
+ Welcome to the official FastHTML documentation.
7
+
8
+ FastHTML is a new next-generation web framework for fast, scalable web
9
+ applications with minimal, compact code. It’s designed to be:
10
+
11
+ - Powerful and expressive enough to build the most advanced, interactive
12
+ web apps you can imagine.
13
+ - Fast and lightweight, so you can write less code and get more done.
14
+ - Easy to learn and use, with a simple, intuitive syntax that makes it
15
+ easy to build complex apps quickly.
16
+
17
+ FastHTML apps are just Python code, so you can use FastHTML with the
18
+ full power of the Python language and ecosystem.
19
+
20
+ ## Installation
21
+
22
+ Since `fasthtml` is a Python library, you can install it with:
23
+
24
+ ``` sh
25
+ pip install python-fasthtml
26
+ ```
27
+
28
+ In the near future, we hope to add component libraries that can likewise
29
+ be installed via `pip`.
30
+
31
+ ## Usage
32
+
33
+ For a minimal app, create a file “main.py” as follows:
34
+
35
+ <div class="code-with-filename">
36
+
37
+ **main.py**
38
+
39
+ ``` python
40
+ from fasthtml.common import *
41
+
42
+ app,rt = fast_app()
43
+
44
+ @rt('/')
45
+ def get(): return Div(P('Hello World!'), hx_get="/change")
46
+
47
+ serve()
48
+ ```
49
+
50
+ </div>
51
+
52
+ Running the app with `python main.py` prints out a link to your running
53
+ app: `http://localhost:5001/`. Visit that link in your browser and you
54
+ should see a page with the title “FastHTML” and the text “Let’s do
55
+ this!”. Congratulations - you’ve just created your first `fasthtml` app!
56
+
57
+ Adding interactivity is surprisingly easy, thanks to HTMX. If you modify
58
+ the file to add this function…:
59
+
60
+ <div class="code-with-filename">
61
+
62
+ **main.py**
63
+
64
+ ``` python
65
+ @rt('/change')
66
+ def get(): return P('Nice to be here!')
67
+ ```
68
+
69
+ </div>
70
+
71
+ …you’ll now have a page with a clickable element that changes the text
72
+ when clicked. When clicking on this link, the server will respond with
73
+ an “HTML partial”—that is, just a snippet of HTML which will be inserted
74
+ into the existing page. In this case, the returned element will replace
75
+ the original P element (since that’s the default behavior of HTMX) with
76
+ the new version returned by the second route.
77
+
78
+ This “hypermedia-based” approach to web development is a powerful way to
79
+ build web applications.
80
+
81
+ ## Next Steps
82
+
83
+ Start with the official sources to learn more about FastHTML:
84
+
85
+ - [About](https://about.fastht.ml): Learn about the core ideas behind
86
+ FastHTML
87
+ - [Documentation](https://docs.fastht.ml): Learn from examples how to
88
+ write FastHTML code
89
+ - [Idiomatic
90
+ app](https://github.com/AnswerDotAI/fasthtml/blob/main/examples/adv_app.py):
91
+ Heavily commented source code walking through a complete application,
92
+ including custom authentication, JS library connections, and database
93
+ use.
94
+
95
+ The capabilities of FastHTML are vast and growing, and not all the
96
+ features and patterns have been documented yet. Be prepared to invest
97
+ time into studying and modifying source code, such as the main FastHTML
98
+ repo’s notebooks and the official FastHTML examples repo:
99
+
100
+ - [FastHTML Examples Repo on
101
+ GitHub](https://github.com/AnswerDotAI/fasthtml-example)
102
+ - [FastHTML Repo on GitHub](https://github.com/AnswerDotAI/fasthtml)
103
+
104
+ Then explore the small but growing third-party ecosystem of FastHTML
105
+ tutorials, notebooks, libraries, and components:
106
+
107
+ - [Creating Custom FastHTML Tags for Markdown
108
+ Rendering](https://isaac-flath.github.io/website/posts/boots/FasthtmlTutorial.html)
109
+ by Isaac Flath
110
+ - Your tutorial here!
111
+
112
+ Finally, join the FastHTML community to ask questions, share your work,
113
+ and learn from others:
114
+
115
+ - [Discord](https://discord.gg/qcXvcxMhdP)
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.0"
1
+ __version__ = "0.2.1"
2
2
  from .core import *
3
3
  from .authmw import *
4
4
  from .components import *
@@ -43,4 +43,5 @@ def railway_deploy(
43
43
  _run(f"railway up -c".split())
44
44
  _run(f"railway domain".split())
45
45
  railway_link.__wrapped__()
46
- _run(f"railway volume add -m /app/data".split())
46
+ if mount: _run(f"railway volume add -m /app/data".split())
47
+ _run(f"railway up -c".split())
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.1
2
+ Name: python-fasthtml
3
+ Version: 0.2.1
4
+ Summary: The fastest way to create an HTML app
5
+ Home-page: https://github.com/AnswerDotAI/fasthtml
6
+ Author: Jeremy Howard
7
+ Author-email: github@jhoward.fastmail.fm
8
+ License: Apache Software License 2.0
9
+ Keywords: nbdev jupyter notebook python
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: fastcore>=1.6.0
19
+ Requires-Dist: python-dateutil
20
+ Requires-Dist: starlette>0.33
21
+ Requires-Dist: oauthlib
22
+ Requires-Dist: itsdangerous
23
+ Requires-Dist: uvicorn[standard]>=0.30
24
+ Requires-Dist: httpx
25
+ Requires-Dist: fastlite>=0.0.6
26
+ Requires-Dist: python-multipart
27
+ Requires-Dist: beautifulsoup4
28
+ Provides-Extra: dev
29
+ Requires-Dist: ipython; extra == "dev"
30
+ Requires-Dist: lxml; extra == "dev"
31
+
32
+ # FastHTML
33
+
34
+
35
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
36
+
37
+ Welcome to the official FastHTML documentation.
38
+
39
+ FastHTML is a new next-generation web framework for fast, scalable web
40
+ applications with minimal, compact code. It’s designed to be:
41
+
42
+ - Powerful and expressive enough to build the most advanced, interactive
43
+ web apps you can imagine.
44
+ - Fast and lightweight, so you can write less code and get more done.
45
+ - Easy to learn and use, with a simple, intuitive syntax that makes it
46
+ easy to build complex apps quickly.
47
+
48
+ FastHTML apps are just Python code, so you can use FastHTML with the
49
+ full power of the Python language and ecosystem.
50
+
51
+ ## Installation
52
+
53
+ Since `fasthtml` is a Python library, you can install it with:
54
+
55
+ ``` sh
56
+ pip install python-fasthtml
57
+ ```
58
+
59
+ In the near future, we hope to add component libraries that can likewise
60
+ be installed via `pip`.
61
+
62
+ ## Usage
63
+
64
+ For a minimal app, create a file “main.py” as follows:
65
+
66
+ <div class="code-with-filename">
67
+
68
+ **main.py**
69
+
70
+ ``` python
71
+ from fasthtml.common import *
72
+
73
+ app,rt = fast_app()
74
+
75
+ @rt('/')
76
+ def get(): return Div(P('Hello World!'), hx_get="/change")
77
+
78
+ serve()
79
+ ```
80
+
81
+ </div>
82
+
83
+ Running the app with `python main.py` prints out a link to your running
84
+ app: `http://localhost:5001/`. Visit that link in your browser and you
85
+ should see a page with the title “FastHTML” and the text “Let’s do
86
+ this!”. Congratulations - you’ve just created your first `fasthtml` app!
87
+
88
+ Adding interactivity is surprisingly easy, thanks to HTMX. If you modify
89
+ the file to add this function…:
90
+
91
+ <div class="code-with-filename">
92
+
93
+ **main.py**
94
+
95
+ ``` python
96
+ @rt('/change')
97
+ def get(): return P('Nice to be here!')
98
+ ```
99
+
100
+ </div>
101
+
102
+ …you’ll now have a page with a clickable element that changes the text
103
+ when clicked. When clicking on this link, the server will respond with
104
+ an “HTML partial”—that is, just a snippet of HTML which will be inserted
105
+ into the existing page. In this case, the returned element will replace
106
+ the original P element (since that’s the default behavior of HTMX) with
107
+ the new version returned by the second route.
108
+
109
+ This “hypermedia-based” approach to web development is a powerful way to
110
+ build web applications.
111
+
112
+ ## Next Steps
113
+
114
+ Start with the official sources to learn more about FastHTML:
115
+
116
+ - [About](https://about.fastht.ml): Learn about the core ideas behind
117
+ FastHTML
118
+ - [Documentation](https://docs.fastht.ml): Learn from examples how to
119
+ write FastHTML code
120
+ - [Idiomatic
121
+ app](https://github.com/AnswerDotAI/fasthtml/blob/main/examples/adv_app.py):
122
+ Heavily commented source code walking through a complete application,
123
+ including custom authentication, JS library connections, and database
124
+ use.
125
+
126
+ The capabilities of FastHTML are vast and growing, and not all the
127
+ features and patterns have been documented yet. Be prepared to invest
128
+ time into studying and modifying source code, such as the main FastHTML
129
+ repo’s notebooks and the official FastHTML examples repo:
130
+
131
+ - [FastHTML Examples Repo on
132
+ GitHub](https://github.com/AnswerDotAI/fasthtml-example)
133
+ - [FastHTML Repo on GitHub](https://github.com/AnswerDotAI/fasthtml)
134
+
135
+ Then explore the small but growing third-party ecosystem of FastHTML
136
+ tutorials, notebooks, libraries, and components:
137
+
138
+ - [Creating Custom FastHTML Tags for Markdown
139
+ Rendering](https://isaac-flath.github.io/website/posts/boots/FasthtmlTutorial.html)
140
+ by Isaac Flath
141
+ - Your tutorial here!
142
+
143
+ Finally, join the FastHTML community to ask questions, share your work,
144
+ and learn from others:
145
+
146
+ - [Discord](https://discord.gg/qcXvcxMhdP)
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = fasthtml
3
3
  lib_name = fasthtml
4
- version = 0.2.0
4
+ version = 0.2.1
5
5
  min_python = 3.10
6
6
  license = apache2
7
7
  requirements = fastcore>=1.6.0 python-dateutil starlette>0.33 oauthlib itsdangerous uvicorn[standard]>=0.30 httpx fastlite>=0.0.6 python-multipart beautifulsoup4