From 6e5e630d285891bfa38cf0a477e35e292773a0b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:46:37 +0000 Subject: [PATCH 1/4] Initial plan From 0f0b40c78956b05b7c291d103be77f21a2c9237b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:54:00 +0000 Subject: [PATCH 2/4] Move about page content away from root README.md to dedicated file Co-authored-by: CNSeniorious000 <74518716+CNSeniorious000@users.noreply.github.com> --- README.md => src/content/about.md | 0 src/routes/(notebook)/about/+page.svelte | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename README.md => src/content/about.md (100%) diff --git a/README.md b/src/content/about.md similarity index 100% rename from README.md rename to src/content/about.md diff --git a/src/routes/(notebook)/about/+page.svelte b/src/routes/(notebook)/about/+page.svelte index 41e3a8be..81056256 100644 --- a/src/routes/(notebook)/about/+page.svelte +++ b/src/routes/(notebook)/about/+page.svelte @@ -1,6 +1,6 @@ - + From 1f2e3a3ea876c0b4485744304a428eac26ef9b7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:08:00 +0000 Subject: [PATCH 3/4] Add comprehensive README.md documenting the whole project Co-authored-by: CNSeniorious000 <74518716+CNSeniorious000@users.noreply.github.com> --- README.md | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..e40d4415 --- /dev/null +++ b/README.md @@ -0,0 +1,146 @@ +# Pyth-on-line + +> A browser-based Python development environment with hot module reloading + +Pyth-on-line is a comprehensive web-based Python development platform that runs entirely in your browser using WebAssembly. Built with SvelteKit and powered by Pyodide, it provides a modern, interactive Python development experience without requiring any local installations. + +## 🚀 Features + +### Core Capabilities +- **Browser-based Python interpreter** - Full CPython experience running on WebAssembly via Pyodide +- **Interactive code execution** - Run Python code with real-time output and interactive debugging +- **Package management** - Support for pure Python packages and many popular libraries (NumPy, Pandas, SciPy, etc.) +- **Hot Module Reloading** - Advanced reactivity system for efficient code reloading +- **Multi-format support** - Work with Jupyter notebooks, Python scripts, and interactive sessions + +### Development Environment +- **Workspace management** - Organize projects with file trees and multiple editors +- **GitHub integration** - Import and export projects directly from/to GitHub repositories +- **Gist support** - Share code snippets via GitHub Gists +- **Real-time collaboration** - Share interactive Python sessions with others + +### Advanced Features +- **Top-level await support** - Use async/await at the module level +- **Web API access** - Interact with browser APIs and make HTTP requests +- **Rich debugging** - Native Python tracebacks and error handling +- **Package installation** - Install packages from PyPI using micropip + +## 🏗️ Architecture + +This project is structured as a monorepo containing: + +### Web Application (`src/`) +- **SvelteKit frontend** - Modern web interface built with Svelte and TypeScript +- **Pyodide integration** - WebAssembly Python runtime +- **Monaco Editor** - Advanced code editing with syntax highlighting +- **Workspace system** - File management and project organization + +### HMR Library (`packages/hmr/`) +Hot Module Reload system for Python that provides: +- **Dependency tracking** - Runtime analysis of module dependencies +- **Selective reloading** - Only reload modules that have changed +- **Push-pull reactivity** - Efficient update propagation +- **CLI interface** - Command-line tool for local development + +## 🛠️ Development + +### Prerequisites +- Node.js 18+ and pnpm +- Python 3.13+ (for HMR development) + +### Getting Started + +```bash +# Clone the repository +git clone https://github.com/promplate/pyth-on-line.git +cd pyth-on-line + +# Install dependencies +pnpm install + +# Start development server +pnpm dev +``` + +### Project Structure + +``` +├── src/ # SvelteKit web application +│ ├── routes/ # Page routes and API endpoints +│ ├── lib/ # Shared components and utilities +│ ├── content/ # Static content (about page, etc.) +│ └── python/ # Python runtime configuration +├── packages/ +│ └── hmr/ # Hot Module Reload library +├── tests/ # Python test suite +└── static/ # Static assets +``` + +### Available Scripts + +- `pnpm dev` - Start development server +- `pnpm build` - Build for production +- `pnpm preview` - Preview production build +- `pnpm check` - Type checking with svelte-check +- `pnpm lint` - Lint code with ESLint + +## 🔧 HMR Library + +The included HMR (Hot Module Reload) library provides efficient code reloading for Python development: + +```bash +# Install HMR globally +pip install hmr + +# Use instead of python command +hmr your_script.py + +# Or with arguments +hmr your_script.py --arg1 value1 +``` + +### HMR Features +- **Runtime dependency tracking** - Monitors module relationships during execution +- **Selective reloading** - Only reloads changed modules and their dependents +- **Preserves state** - Maintains application state across reloads where possible +- **Virtual environment support** - Works with all Python package managers + +## 🌐 Deployment + +The application is designed for easy deployment on modern web platforms: + +- **Netlify** - Configured with `@sveltejs/adapter-netlify` +- **Static hosting** - Can be deployed as a static site +- **CDN friendly** - Optimized for content delivery networks + +## 🤝 Contributing + +We welcome contributions! Please see our [contributing guidelines](./CONTRIBUTING.md) for details. + +### Development Workflow +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Add tests if applicable +5. Submit a pull request + +## 📄 License + +This project is open source and available under the [MIT License](./LICENSE). + +## 🙏 Acknowledgments + +- **[Pyodide](https://github.com/pyodide/pyodide)** - WebAssembly Python runtime +- **[StackBlitz](https://stackblitz.com/)** - Inspiration for browser-based development +- **[Marimo](https://github.com/marimo-team/marimo)** - Reactive notebook concepts +- **[CodePen](https://codepen.io/)** - Interactive code sharing ideas + +## 📞 Support + +- **Discussions** - [GitHub Discussions](https://github.com/promplate/pyth-on-line/discussions) +- **Issues** - [GitHub Issues](https://github.com/promplate/pyth-on-line/issues) +- **Documentation** - [Project Wiki](https://github.com/promplate/pyth-on-line/wiki) + +--- + +Built with ❤️ by the Promplate team \ No newline at end of file From 21534d7f1a7c90dbc58572b141e569c95f9fb4ce Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Mon, 1 Sep 2025 23:55:23 +0800 Subject: [PATCH 4/4] Add trailing newline --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e40d4415..7e399b7c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Pyth-on-line is a comprehensive web-based Python development platform that runs ## 🚀 Features ### Core Capabilities + - **Browser-based Python interpreter** - Full CPython experience running on WebAssembly via Pyodide - **Interactive code execution** - Run Python code with real-time output and interactive debugging - **Package management** - Support for pure Python packages and many popular libraries (NumPy, Pandas, SciPy, etc.) @@ -14,12 +15,14 @@ Pyth-on-line is a comprehensive web-based Python development platform that runs - **Multi-format support** - Work with Jupyter notebooks, Python scripts, and interactive sessions ### Development Environment + - **Workspace management** - Organize projects with file trees and multiple editors - **GitHub integration** - Import and export projects directly from/to GitHub repositories - **Gist support** - Share code snippets via GitHub Gists - **Real-time collaboration** - Share interactive Python sessions with others ### Advanced Features + - **Top-level await support** - Use async/await at the module level - **Web API access** - Interact with browser APIs and make HTTP requests - **Rich debugging** - Native Python tracebacks and error handling @@ -30,13 +33,16 @@ Pyth-on-line is a comprehensive web-based Python development platform that runs This project is structured as a monorepo containing: ### Web Application (`src/`) + - **SvelteKit frontend** - Modern web interface built with Svelte and TypeScript - **Pyodide integration** - WebAssembly Python runtime - **Monaco Editor** - Advanced code editing with syntax highlighting - **Workspace system** - File management and project organization ### HMR Library (`packages/hmr/`) + Hot Module Reload system for Python that provides: + - **Dependency tracking** - Runtime analysis of module dependencies - **Selective reloading** - Only reload modules that have changed - **Push-pull reactivity** - Efficient update propagation @@ -45,6 +51,7 @@ Hot Module Reload system for Python that provides: ## 🛠️ Development ### Prerequisites + - Node.js 18+ and pnpm - Python 3.13+ (for HMR development) @@ -100,6 +107,7 @@ hmr your_script.py --arg1 value1 ``` ### HMR Features + - **Runtime dependency tracking** - Monitors module relationships during execution - **Selective reloading** - Only reloads changed modules and their dependents - **Preserves state** - Maintains application state across reloads where possible @@ -118,6 +126,7 @@ The application is designed for easy deployment on modern web platforms: We welcome contributions! Please see our [contributing guidelines](./CONTRIBUTING.md) for details. ### Development Workflow + 1. Fork the repository 2. Create a feature branch 3. Make your changes @@ -143,4 +152,4 @@ This project is open source and available under the [MIT License](./LICENSE). --- -Built with ❤️ by the Promplate team \ No newline at end of file +Built with ❤️ by the Promplate team