pulse-framework 0.1.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.
- pulse_framework-0.1.0/.claude/settings.local.json +9 -0
- pulse_framework-0.1.0/.gitignore +173 -0
- pulse_framework-0.1.0/.python-version +1 -0
- pulse_framework-0.1.0/.vscode/settings.json +11 -0
- pulse_framework-0.1.0/LICENSE +21 -0
- pulse_framework-0.1.0/PKG-INFO +38 -0
- pulse_framework-0.1.0/README.md +22 -0
- pulse_framework-0.1.0/TUTORIAL.md +1139 -0
- pulse_framework-0.1.0/advanced.py +1564 -0
- pulse_framework-0.1.0/auth.py +259 -0
- pulse_framework-0.1.0/bun.lock +1021 -0
- pulse_framework-0.1.0/main.py +544 -0
- pulse_framework-0.1.0/package.json +5 -0
- pulse_framework-0.1.0/pulse/__init__.py +175 -0
- pulse_framework-0.1.0/pulse/app.py +349 -0
- pulse_framework-0.1.0/pulse/cmd.py +324 -0
- pulse_framework-0.1.0/pulse/codegen.py +147 -0
- pulse_framework-0.1.0/pulse/components/__init__.py +1 -0
- pulse_framework-0.1.0/pulse/components/react_router.py +43 -0
- pulse_framework-0.1.0/pulse/context.py +15 -0
- pulse_framework-0.1.0/pulse/decorators.py +187 -0
- pulse_framework-0.1.0/pulse/diff.py +252 -0
- pulse_framework-0.1.0/pulse/flags.py +5 -0
- pulse_framework-0.1.0/pulse/flatted.py +159 -0
- pulse_framework-0.1.0/pulse/helpers.py +27 -0
- pulse_framework-0.1.0/pulse/hooks.py +441 -0
- pulse_framework-0.1.0/pulse/html/__init__.py +304 -0
- pulse_framework-0.1.0/pulse/html/attributes.py +930 -0
- pulse_framework-0.1.0/pulse/html/elements.py +1024 -0
- pulse_framework-0.1.0/pulse/html/events.py +419 -0
- pulse_framework-0.1.0/pulse/html/tags.py +171 -0
- pulse_framework-0.1.0/pulse/html/tags.pyi +390 -0
- pulse_framework-0.1.0/pulse/messages.py +109 -0
- pulse_framework-0.1.0/pulse/middleware.py +158 -0
- pulse_framework-0.1.0/pulse/query.py +286 -0
- pulse_framework-0.1.0/pulse/react_component.py +803 -0
- pulse_framework-0.1.0/pulse/reactive.py +514 -0
- pulse_framework-0.1.0/pulse/reactive_extensions.py +626 -0
- pulse_framework-0.1.0/pulse/reconciler.py +575 -0
- pulse_framework-0.1.0/pulse/request.py +162 -0
- pulse_framework-0.1.0/pulse/routing.py +350 -0
- pulse_framework-0.1.0/pulse/session.py +310 -0
- pulse_framework-0.1.0/pulse/state.py +309 -0
- pulse_framework-0.1.0/pulse/templates.py +171 -0
- pulse_framework-0.1.0/pulse/tests/__init__.py +0 -0
- pulse_framework-0.1.0/pulse/tests/old_test_diff.py +174 -0
- pulse_framework-0.1.0/pulse/tests/test_codegen.py +224 -0
- pulse_framework-0.1.0/pulse/tests/test_flatted.py +297 -0
- pulse_framework-0.1.0/pulse/tests/test_nodes.py +439 -0
- pulse_framework-0.1.0/pulse/tests/test_query.py +391 -0
- pulse_framework-0.1.0/pulse/tests/test_react.py +797 -0
- pulse_framework-0.1.0/pulse/tests/test_reactive.py +1203 -0
- pulse_framework-0.1.0/pulse/tests/test_reconciler.py +1759 -0
- pulse_framework-0.1.0/pulse/tests/test_routing.py +167 -0
- pulse_framework-0.1.0/pulse/tests/test_session.py +267 -0
- pulse_framework-0.1.0/pulse/tests/test_state.py +569 -0
- pulse_framework-0.1.0/pulse/tests/test_utils.py +101 -0
- pulse_framework-0.1.0/pulse/vdom.py +381 -0
- pulse_framework-0.1.0/pulse-ui-client/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc +1 -0
- pulse_framework-0.1.0/pulse-ui-client/.gitignore +34 -0
- pulse_framework-0.1.0/pulse-ui-client/CLAUDE.md +111 -0
- pulse_framework-0.1.0/pulse-ui-client/README.md +15 -0
- pulse_framework-0.1.0/pulse-ui-client/bun.lock +70 -0
- pulse_framework-0.1.0/pulse-ui-client/package.json +39 -0
- pulse_framework-0.1.0/pulse-ui-client/src/client.tsx +321 -0
- pulse_framework-0.1.0/pulse-ui-client/src/helpers.ts +27 -0
- pulse_framework-0.1.0/pulse-ui-client/src/index.ts +73 -0
- pulse_framework-0.1.0/pulse-ui-client/src/messages.ts +92 -0
- pulse_framework-0.1.0/pulse-ui-client/src/pulse.tsx +233 -0
- pulse_framework-0.1.0/pulse-ui-client/src/renderer.tsx +303 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/clean.test.ts +75 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/clean.ts +263 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/elements.ts +796 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/events.ts +324 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/extractor.ts +30 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/flatted.test.ts +500 -0
- pulse_framework-0.1.0/pulse-ui-client/src/serialize/flatted.ts +200 -0
- pulse_framework-0.1.0/pulse-ui-client/src/transport.ts +154 -0
- pulse_framework-0.1.0/pulse-ui-client/src/vdom.ts +105 -0
- pulse_framework-0.1.0/pulse-ui-client/tsconfig.build.json +14 -0
- pulse_framework-0.1.0/pulse-ui-client/tsconfig.json +29 -0
- pulse_framework-0.1.0/pyproject.toml +29 -0
- pulse_framework-0.1.0/tutorial.py +879 -0
- pulse_framework-0.1.0/uv.lock +653 -0
- pulse_framework-0.1.0/weather_demo.py +406 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.py[cod]
|
|
6
|
+
*$py.class
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
share/python-wheels/
|
|
26
|
+
*.egg-info/
|
|
27
|
+
.installed.cfg
|
|
28
|
+
*.egg
|
|
29
|
+
MANIFEST
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
cover/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# UV
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
#uv.lock
|
|
104
|
+
|
|
105
|
+
# poetry
|
|
106
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
107
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
108
|
+
# commonly ignored for libraries.
|
|
109
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
110
|
+
#poetry.lock
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
#pdm.lock
|
|
115
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
116
|
+
# in version control.
|
|
117
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
118
|
+
.pdm.toml
|
|
119
|
+
.pdm-python
|
|
120
|
+
.pdm-build/
|
|
121
|
+
|
|
122
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
123
|
+
__pypackages__/
|
|
124
|
+
|
|
125
|
+
# Celery stuff
|
|
126
|
+
celerybeat-schedule
|
|
127
|
+
celerybeat.pid
|
|
128
|
+
|
|
129
|
+
# SageMath parsed files
|
|
130
|
+
*.sage.py
|
|
131
|
+
|
|
132
|
+
# Environments
|
|
133
|
+
.env
|
|
134
|
+
.venv
|
|
135
|
+
env/
|
|
136
|
+
venv/
|
|
137
|
+
ENV/
|
|
138
|
+
env.bak/
|
|
139
|
+
venv.bak/
|
|
140
|
+
|
|
141
|
+
# Spyder project settings
|
|
142
|
+
.spyderproject
|
|
143
|
+
.spyproject
|
|
144
|
+
|
|
145
|
+
# Rope project settings
|
|
146
|
+
.ropeproject
|
|
147
|
+
|
|
148
|
+
# mkdocs documentation
|
|
149
|
+
/site
|
|
150
|
+
|
|
151
|
+
# mypy
|
|
152
|
+
.mypy_cache/
|
|
153
|
+
.dmypy.json
|
|
154
|
+
dmypy.json
|
|
155
|
+
|
|
156
|
+
# Pyre type checker
|
|
157
|
+
.pyre/
|
|
158
|
+
|
|
159
|
+
# pytype static type analyzer
|
|
160
|
+
.pytype/
|
|
161
|
+
|
|
162
|
+
# Cython debug symbols
|
|
163
|
+
cython_debug/
|
|
164
|
+
|
|
165
|
+
# PyCharm
|
|
166
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
167
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
168
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
169
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
170
|
+
#.idea/
|
|
171
|
+
|
|
172
|
+
# PyPI configuration file
|
|
173
|
+
.pypirc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Erwin Kuhn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pulse-framework
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Pulse - Full-stack framework for building real-time React applications in Python
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: fastapi>=0.104.0
|
|
8
|
+
Requires-Dist: mako>=1.3.10
|
|
9
|
+
Requires-Dist: python-socketio>=5.13.0
|
|
10
|
+
Requires-Dist: rich>=13.7.1
|
|
11
|
+
Requires-Dist: textual>=5.2.0
|
|
12
|
+
Requires-Dist: typer>=0.16.0
|
|
13
|
+
Requires-Dist: uvicorn>=0.24.0
|
|
14
|
+
Requires-Dist: websockets>=12.0
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# Pulse
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
> [!WARNING]
|
|
21
|
+
> Pulse is currently very early and absolutely not production-ready. I am currently piloting it for internal usage. I do not recommend it using it for an application at this stage, as project support in the CLI is non-existent and you will likely encounter problems.
|
|
22
|
+
|
|
23
|
+
Pulse is a full-stack Python framework to build React applications. It aims to be the best way to build complex web applications from Python.
|
|
24
|
+
|
|
25
|
+
Pulse's guiding principles are:
|
|
26
|
+
- Straightforward code, it's "just Python". Pulse tries really hard to avoid surprises and magic.
|
|
27
|
+
- Performance. Your app should respond to user interactions as fast as the speed of light allows. Your dev workflow should be the same: fast starts and instant reloads.
|
|
28
|
+
- Extremely easy integration with the JavaScript and React ecosystems. Want to install a library and use its React components from Python? Want to add your own custom React components to your project? You got it.
|
|
29
|
+
|
|
30
|
+
## Project structure
|
|
31
|
+
|
|
32
|
+
A Pulse project has two parts:
|
|
33
|
+
- The Pulse Python server, where most of your application is defined.
|
|
34
|
+
- The React application, using [Vite](https://vite.dev/) and [React Router](https://reactrouter.com/home). Pulse generates routes and runs the app for you, but you are free to modify and extend the project as you wish.
|
|
35
|
+
|
|
36
|
+
You can see an example in the `pulse-demo/` folder. Typically, a Pulse project contains the Python server at the top-level and the React application in a subfolder, named `pulse-web/` by default. This is not a prescription however, you can configure Pulse to have the React application anywhere you want it.
|
|
37
|
+
|
|
38
|
+
Pulse's CLI is currently limited to running the Pulse application, or just generating the Pulse routes in the React application. There are no utilities to help with project setup. If you want to use Pulse, you will need to install the `pulse-ui-client` package from NPM and the `pulse` Python package from Git, and imitate the setup in `pulse-demo/` yourself.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Pulse
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
> [!WARNING]
|
|
5
|
+
> Pulse is currently very early and absolutely not production-ready. I am currently piloting it for internal usage. I do not recommend it using it for an application at this stage, as project support in the CLI is non-existent and you will likely encounter problems.
|
|
6
|
+
|
|
7
|
+
Pulse is a full-stack Python framework to build React applications. It aims to be the best way to build complex web applications from Python.
|
|
8
|
+
|
|
9
|
+
Pulse's guiding principles are:
|
|
10
|
+
- Straightforward code, it's "just Python". Pulse tries really hard to avoid surprises and magic.
|
|
11
|
+
- Performance. Your app should respond to user interactions as fast as the speed of light allows. Your dev workflow should be the same: fast starts and instant reloads.
|
|
12
|
+
- Extremely easy integration with the JavaScript and React ecosystems. Want to install a library and use its React components from Python? Want to add your own custom React components to your project? You got it.
|
|
13
|
+
|
|
14
|
+
## Project structure
|
|
15
|
+
|
|
16
|
+
A Pulse project has two parts:
|
|
17
|
+
- The Pulse Python server, where most of your application is defined.
|
|
18
|
+
- The React application, using [Vite](https://vite.dev/) and [React Router](https://reactrouter.com/home). Pulse generates routes and runs the app for you, but you are free to modify and extend the project as you wish.
|
|
19
|
+
|
|
20
|
+
You can see an example in the `pulse-demo/` folder. Typically, a Pulse project contains the Python server at the top-level and the React application in a subfolder, named `pulse-web/` by default. This is not a prescription however, you can configure Pulse to have the React application anywhere you want it.
|
|
21
|
+
|
|
22
|
+
Pulse's CLI is currently limited to running the Pulse application, or just generating the Pulse routes in the React application. There are no utilities to help with project setup. If you want to use Pulse, you will need to install the `pulse-ui-client` package from NPM and the `pulse` Python package from Git, and imitate the setup in `pulse-demo/` yourself.
|