pyrepl-web 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Savannah Ostrowski
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.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # pyrepl-web
2
+
3
+ An embeddable Python REPL powered by Pyodide.
4
+
5
+ ## Features
6
+
7
+ - Full Python 3.13 running in the browser via WebAssembly
8
+ - Syntax highlighting with Pygments
9
+ - Tab completion
10
+ - Command history (up/down arrows)
11
+ - Smart indentation
12
+ - Preload any PyPI packages
13
+ - Multiple color themes (Catppuccin Mocha/Latte)
14
+
15
+ ## Usage
16
+
17
+ Add a `.pyrepl` div and include the script from a CDN:
18
+
19
+ ```html
20
+ <script src="https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js"></script>
21
+
22
+ <div class="pyrepl"></div>
23
+ ```
24
+
25
+ That's it! No install needed.
26
+
27
+ ### Options
28
+
29
+ Configure via `data-*` attributes:
30
+
31
+ ```html
32
+ <!-- Dark theme (default) -->
33
+ <div class="pyrepl" data-theme="catppuccin-mocha"></div>
34
+
35
+ <!-- Light theme -->
36
+ <div class="pyrepl" data-theme="catppuccin-latte"></div>
37
+
38
+ <!-- Preload packages -->
39
+ <div class="pyrepl" data-packages="numpy, pandas"></div>
40
+
41
+ <!-- Combined -->
42
+ <div class="pyrepl"
43
+ data-theme="catppuccin-latte"
44
+ data-packages="pydantic, requests">
45
+ </div>
46
+ ```
47
+
48
+ ### Attributes
49
+
50
+ | Attribute | Description | Default |
51
+ |-----------|-------------|---------|
52
+ | `data-theme` | Color theme (`catppuccin-mocha` or `catppuccin-latte`) | `catppuccin-mocha` |
53
+ | `data-packages` | Comma-separated list of PyPI packages to preload | none |
54
+
55
+ ## Development
56
+
57
+ ```bash
58
+ # Install dependencies
59
+ bun install
60
+
61
+ # Run dev server
62
+ bun run src/server.ts
63
+
64
+ # Build for production
65
+ bun run build.ts
66
+ ```
67
+
68
+ ## How it works
69
+
70
+ pyrepl-web uses:
71
+ - [Pyodide](https://pyodide.org/) - Python compiled to WebAssembly
72
+ - [xterm.js](https://xtermjs.org/) - Terminal emulator
73
+ - [Pygments](https://pygments.org/) - Syntax highlighting
74
+ - [Catppuccin](https://github.com/catppuccin/catppuccin) - Color themes