https://github.com/europanite/client_side_python
A Browser-Based Python Playground for Free.
https://github.com/europanite/client_side_python
android browser client-side cross-platform docker docker-compose emulation emulator expo free frontend ios metro pyodide python python-emulator python-environment react react-native typescript
Last synced: 29 days ago
JSON representation
A Browser-Based Python Playground for Free.
- Host: GitHub
- URL: https://github.com/europanite/client_side_python
- Owner: europanite
- License: apache-2.0
- Created: 2025-10-18T04:09:28.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-26T14:55:27.000Z (5 months ago)
- Last Synced: 2025-12-28T02:45:16.867Z (5 months ago)
- Topics: android, browser, client-side, cross-platform, docker, docker-compose, emulation, emulator, expo, free, frontend, ios, metro, pyodide, python, python-emulator, python-environment, react, react-native, typescript
- Language: TypeScript
- Homepage: https://europanite.github.io/client_side_python/
- Size: 513 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# [Client Side Python](https://github.com/europanite/client_side_python "Client Side Python")
[](https://opensource.org/licenses/Apache-2.0)

[](https://github.com/europanite/client_side_python/actions/workflows/ci.yml)
[](https://github.com/europanite/client_side_python/actions/workflows/docker.yml)
[](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml)





[PlayGround](https://europanite.github.io/client_side_python/)
A Browser-based Python Runner playground powered by Pyodide. Try Python code in your web browser. No server, No account, or No payment is required.
---
## Overview
Client Side Python is a **browser-based Python playground powered by Pyodide**.
Python code runs **inside your browser tab** (WebAssembly, no backend).
This makes it useful for:
- Quickly trying out small Python snippets
- Demonstrating Python basics in a classroom or workshop
- Experimenting with simple numeric or scripting tasks in a safe sandbox
- Showing how WebAssembly + Pyodide can bring βrealβ Python to the browser
---
## Features
- **Fully client-side execution**
- Uses [Pyodide](https://pyodide.org) to run CPython in WebAssembly.
- No server, No database, No authentication required by default.
- **Simple code editor + console**
- Text area for Python code.
- Console area that shows `stdout` and `stderr`.
- Buttons: **Run**, **Stop**, **Clear**, **Load Sample**, **Copy Output**.
- **Responsive web UI**
- Built with **Expo / React Native Web**.
- Layout adapts to different viewport sizes (desktop / tablet).
- **Deterministic CI via Docker**
- Jest tests run in a Docker container.
---
## How It Works
On first load, the app:
1. Fetches Pyodide from a CDN.
2. Initializes the Pyodide runtime and exposes `runPythonAsync`.
3. Attaches custom handlers for `stdout` and `stderr` so that Python output is streamed into the in-page console.
4. Uses a simple execution token to implement a **soft Stop**:
- Each run increments an internal `execId`.
- If a run finishes with an outdated `execId`, its output is discarded.
- This prevents stale results from older runs from polluting the console.
All of this happens **in the browser**, without any backend API calls.
---
## π Getting Started
### 1. Prerequisites
- [Docker](https://www.docker.com/) & [Docker Compose](https://docs.docker.com/compose/)
### 2. Build and start all services:
```bash
# set environment variables:
export REACT_NATIVE_PACKAGER_HOSTNAME=${YOUR_HOST}
# Build the image
docker compose build
# Run the container
docker compose up
```
### 3. Test:
```bash
docker compose \
-f docker-compose.test.yml up \
--build --exit-code-from \
frontend_test
```
---
# License
- Apache License 2.0