pyte-cli 0.2.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.
pyte_cli-0.2.0/LICENSE ADDED
@@ -0,0 +1,35 @@
1
+ Pyte License 1.0
2
+
3
+ Copyright (c) 2026 Rajveer Jadhav
4
+
5
+ "Software" means pyte: its source code and documentation.
6
+
7
+ 1. Permission. Anyone may use, copy, modify and share the Software free of
8
+ charge, for any purpose, including at work, subject to the terms below.
9
+
10
+ 2. Credit. Copies of the Software, modified or not, must keep this license and
11
+ the copyright line above.
12
+
13
+ 3. Changes. Modified versions you share must say they were changed and must be
14
+ shared under this license, with source code.
15
+
16
+ 4. No selling. You may not sell the Software or a modified version, or charge
17
+ for access to it as a product or service.
18
+
19
+ 5. Your projects. Projects you make with pyte are yours. This license places no
20
+ conditions on your code, your assets, or pyte starter and page code copied
21
+ into your project or build output. You may license or sell your projects as
22
+ you like.
23
+
24
+ 6. Name. Modified versions must use a different name than "pyte".
25
+
26
+ 7. Other software. The Go runtime and wasm_exec.js included in pyte and its
27
+ builds are not covered. Their own license applies.
28
+
29
+ 8. Ending. Breaking these terms ends your permission. It returns if you fix the
30
+ breach within 30 days of learning of it.
31
+
32
+ 9. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33
+ EXPRESS OR IMPLIED. TO THE EXTENT THE LAW ALLOWS, THE AUTHOR IS NOT LIABLE
34
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE SOFTWARE OR ITS
35
+ USE.
@@ -0,0 +1,42 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyte-cli
3
+ Version: 0.2.0
4
+ License: Pyte License 1.0
5
+
6
+ Copyright (c) 2026 Rajveer Jadhav
7
+
8
+ "Software" means pyte: its source code and documentation.
9
+
10
+ 1. Permission. Anyone may use, copy, modify and share the Software free of
11
+ charge, for any purpose, including at work, subject to the terms below.
12
+
13
+ 2. Credit. Copies of the Software, modified or not, must keep this license and
14
+ the copyright line above.
15
+
16
+ 3. Changes. Modified versions you share must say they were changed and must be
17
+ shared under this license, with source code.
18
+
19
+ 4. No selling. You may not sell the Software or a modified version, or charge
20
+ for access to it as a product or service.
21
+
22
+ 5. Your projects. Projects you make with pyte are yours. This license places no
23
+ conditions on your code, your assets, or pyte starter and page code copied
24
+ into your project or build output. You may license or sell your projects as
25
+ you like.
26
+
27
+ 6. Name. Modified versions must use a different name than "pyte".
28
+
29
+ 7. Other software. The Go runtime and wasm_exec.js included in pyte and its
30
+ builds are not covered. Their own license applies.
31
+
32
+ 8. Ending. Breaking these terms ends your permission. It returns if you fix the
33
+ breach within 30 days of learning of it.
34
+
35
+ 9. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36
+ EXPRESS OR IMPLIED. TO THE EXTENT THE LAW ALLOWS, THE AUTHOR IS NOT LIABLE
37
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE SOFTWARE OR ITS
38
+ USE.
39
+
40
+ Requires-Python: >=3.11
41
+ License-File: LICENSE
42
+ Dynamic: license-file
@@ -0,0 +1,120 @@
1
+ # pyte
2
+
3
+ Vite-like tool for Python in the browser. Needs Python 3.11+.
4
+ pyte has its own interpreter (interp/, written in Go, compiled to wasm). It runs a
5
+ subset of Python. No CPython, no packages, no downloads.
6
+
7
+ ## Start
8
+
9
+ pip install pyteonsite
10
+ pyte init myapp
11
+ cd myapp
12
+ pyte dev
13
+
14
+ ## Commands
15
+
16
+ pyte init [dir] starter project
17
+ pyte dev [dir] dev server, live reload (port 9473)
18
+ pyte build [dir] dist/ with index.html + wasm + app.json
19
+ pyte preview [dir] serve dist/
20
+ pyte url [dir] show URL, whether running (exit 1 if not)
21
+
22
+ dev, preview, url accept --host and --port. Pass same flags to url.
23
+
24
+ ## pyte.toml
25
+
26
+ [project]
27
+ title = "My app"
28
+ entry = "src/main.py" # must be in subfolder
29
+
30
+ [server]
31
+ host = "127.0.0.1" # "0.0.0.0" or your IP for other devices
32
+ port = 9473
33
+
34
+ [assets]
35
+ dir = "assets"
36
+ favicon = "logo.ico" # file in assets, published as favicon.ico
37
+
38
+ [build]
39
+ out = "dist"
40
+
41
+ ## CLI mode and files
42
+
43
+ [app]
44
+ mode = "cli" # terminal in the page
45
+
46
+ [fs]
47
+ enabled = true # allow writing files
48
+ persist = true # keep them in browser storage
49
+
50
+ Terminal commands: help, ls, cd, pwd, cat, touch, mkdir [-p], rm [-r], mv, cp,
51
+ echo text > file, run file.py args, clear. Anything else runs as Python.
52
+ End indented blocks with empty line; Tab indents. Up/down arrows: history.
53
+
54
+ src/main.py runs first; its functions and variables are usable at the prompt.
55
+ Make own commands:
56
+
57
+ def cmd_greet(name="world"):
58
+ print("hi", name) # type: greet Raj
59
+
60
+ Files: open() with r, w, a, x, `with`, os (listdir, mkdir, makedirs, remove, rmdir,
61
+ rename, getcwd, chdir, path.*), Path read_text/write_text/exists. Text only.
62
+ File system is virtual: it cannot touch files on your computer. Project files are
63
+ read-only. Without [fs] enabled, files can only be read.
64
+
65
+ sys.argv, sys.exit and input() work. In page mode input() opens a popup.
66
+ No Ctrl+C: endless loop freezes tab, and output appears only when code finishes
67
+ or asks for input.
68
+
69
+ ## Phone home screen
70
+
71
+ [app]
72
+ standalone = true
73
+
74
+ [assets]
75
+ touch_icon = "icon.png" # square png, 180x180
76
+
77
+ iPhone: open site in Safari, Share, Add to Home Screen. Does not add offline use.
78
+
79
+ ## Python supported
80
+
81
+ Works: functions, closures, lambdas, decorators, classes (single inheritance), super(),
82
+ if/while/for, with, comprehensions, try/except/finally, raise, f-strings, slicing, own modules,
83
+ int, float, str, bool, list, tuple, dict, common built-ins and methods.
84
+
85
+ Modules: js, math, random (parts), os, sys (argv, exit), pathlib (basic).
86
+
87
+ Missing: sets, generators/yield, async/await, argparse, bytes, complex, properties and
88
+ class/static methods, multiple inheritance, keyword-only parameters, str.format and %
89
+ formatting, walrus, match, bit operators, big integers (64-bit limit), pip packages.
90
+
91
+ ## JavaScript
92
+
93
+ from js import document, window, console, Date
94
+ button.addEventListener("click", on_click)
95
+ now = Date.new()
96
+
97
+ ## Live reload
98
+
99
+ Saving code reruns entry file without restarting Python. #app and output are cleared,
100
+ your modules re-imported, variables reset.
101
+
102
+ Timers and window/document listeners survive. Remove them in:
103
+
104
+ def __pyte_cleanup__():
105
+ ...
106
+
107
+ Full page reload happens if title, favicon, entry or runtime change.
108
+
109
+ ## Notes
110
+
111
+ - Python reads assets with relative paths: open("assets/data.txt")
112
+ - Page has <div id="app"> for your UI; print() shows below it
113
+ - Serve over http(s). Double-clicking index.html fails
114
+ - Everything in entry folder and assets is public. No secrets
115
+ - Server changes in pyte.toml need restart of pyte dev
116
+ - Rebuild interpreter after editing interp/: ./build_runtime.sh (needs Go)
117
+
118
+ ## License
119
+
120
+ Pyte License 1.0, see LICENSE.
@@ -0,0 +1,19 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pyte-cli"
7
+ version = "0.2.0"
8
+ requires-python = ">=3.11"
9
+ license = { file = "LICENSE" }
10
+
11
+ [project.scripts]
12
+ pyte = "pyte:main"
13
+
14
+ [tool.setuptools]
15
+ py-modules = ["pyte"]
16
+ packages = ["pyte_runtime"]
17
+
18
+ [tool.setuptools.package-data]
19
+ pyte_runtime = ["pyte.wasm", "wasm_exec.js", "LICENSE-go.txt"]