Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions README.de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# [Client Side Python](https://github.com/europanite/client_side_python "Client Side Python")

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![OS](https://img.shields.io/badge/OS-Linux%20%7C%20macOS%20%7C%20Windows-blue)
[![CI](https://github.com/europanite/client_side_python/actions/workflows/ci.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/ci.yml)
[![Frontend Tests via Docker](https://github.com/europanite/client_side_python/actions/workflows/docker.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/docker.yml)
[![Deploy Expo Web to GitHub Pages](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml)

![React Native](https://img.shields.io/badge/react_native-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white)
![Expo](https://img.shields.io/badge/expo-1C1E24?style=for-the-badge&logo=expo&logoColor=#D04A37)

<p align="right">
<a href="./README.md">🇺🇸 English</a> |
<a href="./README.ja.md">🇯🇵 日本語</a> |
<a href="./README.zh-CN.md">🇨🇳 简体中文</a> |
<a href="./README.es.md">🇪🇸 Español</a> |
<a href="./README.pt-BR.md">🇧🇷 Português (Brasil)</a> |
<a href="./README.ko.md">🇰🇷 한국어</a> |
<a href="./README.de.md">🇩🇪 Deutsch</a> |
<a href="./README.fr.md">🇫🇷 Français</a>
</p>


> **Note**
> This is a translated version of this README. The English version (`README.md`) is the source of truth.

!["web_ui"](./assets/images/web_ui.png)

[PlayGround](https://europanite.github.io/client_side_python/)

Ein browserbasiertes Python-Playground, das vollständig clientseitig läuft.

---

## Überblick

Client Side Python ist ein **browserbasiertes Python-Playground auf Basis von Pyodide**.
Der gesamte Python-Code wird **vollständig innerhalb deines Browser-Tabs ausgeführt** (WebAssembly, kein Backend), sodass dein Code deine Maschine nie verlässt.

Dadurch eignet es sich gut für:

- Das schnelle Ausprobieren kleiner Python-Snippets
- Das Vorführen von Python-Grundlagen im Unterricht oder in Workshops
- Das Experimentieren mit einfachen numerischen oder Skript-Aufgaben in einer sicheren Sandbox
- Das Zeigen, wie WebAssembly + Pyodide „echtes“ Python in den Browser bringen können

---

## Funktionen

- **Vollständig clientseitige Ausführung**
- Verwendet [Pyodide](https://pyodide.org), um CPython in WebAssembly auszuführen.
- Standardmäßig sind weder Server, Datenbank noch Authentifizierung erforderlich.

- **Einfacher Code-Editor + Konsole**
- Textbereich für Python-Code.
- Konsolenbereich, der `stdout` und `stderr` anzeigt.
- Schaltflächen: **Run**, **Stop**, **Clear**, **Load Sample**, **Copy Output**.

- **Sanfter „Stop“-Mechanismus**
- Die Ausführung ist mit einem Soft-Cancel-Token umhüllt.
- Wenn du **Stop** drückst, wird der aktuelle Lauf logisch abgebrochen, sodass verspätete Ergebnisse ignoriert werden, anstatt die UI zu beschädigen.

- **Responsives Web-UI**
- Erstellt mit **Expo / React Native Web** und **Material UI**-Komponenten.
- Das Layout passt sich an unterschiedliche Viewport-Größen an (Desktop / Tablet).

- **Deterministische CI über Docker**
- Jest-Tests laufen in einem Docker-Container mit `docker-compose.test.yml`.
- GitHub-Actions-Workflows für CI und Docker-basierte Tests sind enthalten.

- **Automatische Bereitstellung auf GitHub Pages**
- Ein GitHub-Actions-Workflow baut das Expo-Web-Bundle und veröffentlicht es für den Branch `main` auf GitHub Pages.

---

## Funktionsweise

Beim ersten Laden der App passiert Folgendes:

1. Pyodide wird von einem CDN geladen.
2. Die Pyodide-Laufzeit wird initialisiert und `runPythonAsync` wird verfügbar gemacht.
3. Benutzerdefinierte Handler für `stdout` und `stderr` werden angebunden, damit Python-Ausgaben in die Konsole auf der Seite gestreamt werden.
4. Ein einfaches Ausführungs-Token wird verwendet, um einen **soft Stop** zu implementieren:
- Jeder Lauf erhöht eine interne `execId`.
- Wenn ein Lauf mit einer veralteten `execId` endet, wird seine Ausgabe verworfen.
- Dadurch wird verhindert, dass veraltete Ergebnisse älterer Läufe die Konsole verschmutzen.

All das geschieht **im Browser**, ganz ohne Backend-API-Aufrufe.

---

## 🚀 Erste Schritte

### 1. Voraussetzungen
- [Docker](https://www.docker.com/) und [Docker Compose](https://docs.docker.com/compose/)

### 2. Alle Services bauen und starten:

```bash
# set environment variables:
export REACT_NATIVE_PACKAGER_HOSTNAME=${YOUR_HOST}

# Build the image
docker compose build

# Run the container
docker compose up
```

### 3. Testen:
```bash
docker compose -f docker-compose.test.yml up --build --exit-code-from frontend_test
```

---

# License
- Apache License 2.0
121 changes: 121 additions & 0 deletions README.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# [Client Side Python](https://github.com/europanite/client_side_python "Client Side Python")

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![OS](https://img.shields.io/badge/OS-Linux%20%7C%20macOS%20%7C%20Windows-blue)
[![CI](https://github.com/europanite/client_side_python/actions/workflows/ci.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/ci.yml)
[![Frontend Tests via Docker](https://github.com/europanite/client_side_python/actions/workflows/docker.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/docker.yml)
[![Deploy Expo Web to GitHub Pages](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml)

![React Native](https://img.shields.io/badge/react_native-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white)
![Expo](https://img.shields.io/badge/expo-1C1E24?style=for-the-badge&logo=expo&logoColor=#D04A37)

<p align="right">
<a href="./README.md">🇺🇸 English</a> |
<a href="./README.ja.md">🇯🇵 日本語</a> |
<a href="./README.zh-CN.md">🇨🇳 简体中文</a> |
<a href="./README.es.md">🇪🇸 Español</a> |
<a href="./README.pt-BR.md">🇧🇷 Português (Brasil)</a> |
<a href="./README.ko.md">🇰🇷 한국어</a> |
<a href="./README.de.md">🇩🇪 Deutsch</a> |
<a href="./README.fr.md">🇫🇷 Français</a>
</p>


> **Note**
> This is a translated version of this README. The English version (`README.md`) is the source of truth.

!["web_ui"](./assets/images/web_ui.png)

[PlayGround](https://europanite.github.io/client_side_python/)

Un playground de Python del lado del cliente y basado en el navegador.

---

## Descripción general

Client Side Python es un **playground de Python basado en el navegador e impulsado por Pyodide**.
Todo el código Python se ejecuta **por completo dentro de tu pestaña del navegador** (WebAssembly, sin backend), por lo que tu código nunca sale de tu máquina.

Esto lo hace útil para:

- Probar rápidamente pequeños fragmentos de código Python
- Demostrar conceptos básicos de Python en una clase o taller
- Experimentar con tareas numéricas o de scripting sencillas en un entorno aislado y seguro
- Mostrar cómo WebAssembly + Pyodide pueden llevar Python “real” al navegador

---

## Características

- **Ejecución totalmente del lado del cliente**
- Usa [Pyodide](https://pyodide.org) para ejecutar CPython en WebAssembly.
- No requiere servidor, base de datos ni autenticación por defecto.

- **Editor de código simple + consola**
- Área de texto para código Python.
- Área de consola que muestra `stdout` y `stderr`.
- Botones: **Run**, **Stop**, **Clear**, **Load Sample**, **Copy Output**.

- **Mecanismo de “Stop” suave**
- La ejecución está envuelta en un token de cancelación suave.
- Cuando pulsas **Stop**, la ejecución actual se cancela lógicamente para que los resultados tardíos se ignoren en lugar de romper la interfaz.

- **Interfaz web responsive**
- Construida con **Expo / React Native Web** y componentes de **Material UI**.
- El diseño se adapta a distintos tamaños de viewport (escritorio / tablet).

- **CI determinista con Docker**
- Las pruebas de Jest se ejecutan dentro de un contenedor Docker usando `docker-compose.test.yml`.
- Se incluyen workflows de GitHub Actions para CI y pruebas basadas en Docker.

- **Despliegue automático en GitHub Pages**
- Un workflow de GitHub Actions compila el bundle web de Expo y lo publica en GitHub Pages para la rama `main`.

---

## Cómo funciona

En la primera carga, la aplicación:

1. Obtiene Pyodide desde una CDN.
2. Inicializa el runtime de Pyodide y expone `runPythonAsync`.
3. Adjunta handlers personalizados para `stdout` y `stderr` para que la salida de Python se envíe en streaming a la consola integrada.
4. Usa un token de ejecución simple para implementar un **soft Stop**:
- Cada ejecución incrementa un `execId` interno.
- Si una ejecución finaliza con un `execId` desactualizado, su salida se descarta.
- Esto evita que resultados obsoletos de ejecuciones anteriores contaminen la consola.

Todo esto sucede **en el navegador**, sin llamadas a ninguna API backend.

---

## 🚀 Primeros pasos

### 1. Requisitos previos
- [Docker](https://www.docker.com/) y [Docker Compose](https://docs.docker.com/compose/)

### 2. Compila e inicia todos los servicios:

```bash
# set environment variables:
export REACT_NATIVE_PACKAGER_HOSTNAME=${YOUR_HOST}

# Build the image
docker compose build

# Run the container
docker compose up
```

### 3. Pruebas:
```bash
docker compose -f docker-compose.test.yml up --build --exit-code-from frontend_test
```

---

# License
- Apache License 2.0
121 changes: 121 additions & 0 deletions README.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# [Client Side Python](https://github.com/europanite/client_side_python "Client Side Python")

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![OS](https://img.shields.io/badge/OS-Linux%20%7C%20macOS%20%7C%20Windows-blue)
[![CI](https://github.com/europanite/client_side_python/actions/workflows/ci.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/ci.yml)
[![Frontend Tests via Docker](https://github.com/europanite/client_side_python/actions/workflows/docker.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/docker.yml)
[![Deploy Expo Web to GitHub Pages](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/europanite/client_side_python/actions/workflows/deploy-pages.yml)

![React Native](https://img.shields.io/badge/react_native-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
![Jest](https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge&logo=jest&logoColor=white)
![Expo](https://img.shields.io/badge/expo-1C1E24?style=for-the-badge&logo=expo&logoColor=#D04A37)

<p align="right">
<a href="./README.md">🇺🇸 English</a> |
<a href="./README.ja.md">🇯🇵 日本語</a> |
<a href="./README.zh-CN.md">🇨🇳 简体中文</a> |
<a href="./README.es.md">🇪🇸 Español</a> |
<a href="./README.pt-BR.md">🇧🇷 Português (Brasil)</a> |
<a href="./README.ko.md">🇰🇷 한국어</a> |
<a href="./README.de.md">🇩🇪 Deutsch</a> |
<a href="./README.fr.md">🇫🇷 Français</a>
</p>


> **Note**
> This is a translated version of this README. The English version (`README.md`) is the source of truth.

!["web_ui"](./assets/images/web_ui.png)

[PlayGround](https://europanite.github.io/client_side_python/)

Un playground Python côté client, accessible directement dans le navigateur.

---

## Vue d’ensemble

Client Side Python est un **playground Python basé sur le navigateur et propulsé par Pyodide**.
Tout le code Python s’exécute **entièrement dans votre onglet de navigateur** (WebAssembly, sans backend), donc votre code ne quitte jamais votre machine.

Cela le rend utile pour :

- Tester rapidement de petits extraits de code Python
- Présenter les bases de Python en classe ou en atelier
- Expérimenter des tâches numériques simples ou du scripting dans un sandbox sécurisé
- Montrer comment WebAssembly + Pyodide peuvent apporter du Python “réel” dans le navigateur

---

## Fonctionnalités

- **Exécution entièrement côté client**
- Utilise [Pyodide](https://pyodide.org) pour exécuter CPython dans WebAssembly.
- Aucun serveur, aucune base de données et aucune authentification ne sont requis par défaut.

- **Éditeur de code simple + console**
- Zone de texte pour le code Python.
- Zone de console affichant `stdout` et `stderr`.
- Boutons : **Run**, **Stop**, **Clear**, **Load Sample**, **Copy Output**.

- **Mécanisme de “Stop” souple**
- L’exécution est encapsulée dans un token d’annulation souple.
- Lorsque vous appuyez sur **Stop**, l’exécution en cours est annulée de façon logique, de sorte que les résultats tardifs soient ignorés au lieu de casser l’interface.

- **Interface web responsive**
- Construite avec **Expo / React Native Web** et des composants **Material UI**.
- La mise en page s’adapte à différentes tailles de viewport (desktop / tablette).

- **CI déterministe via Docker**
- Les tests Jest s’exécutent dans un conteneur Docker à l’aide de `docker-compose.test.yml`.
- Des workflows GitHub Actions sont fournis pour la CI et les tests basés sur Docker.

- **Déploiement automatique vers GitHub Pages**
- Un workflow GitHub Actions construit le bundle web Expo et le publie sur GitHub Pages pour la branche `main`.

---

## Fonctionnement

Lors du premier chargement, l’application :

1. Récupère Pyodide depuis un CDN.
2. Initialise le runtime Pyodide et expose `runPythonAsync`.
3. Attache des gestionnaires personnalisés pour `stdout` et `stderr` afin que la sortie Python soit diffusée dans la console intégrée à la page.
4. Utilise un jeton d’exécution simple pour implémenter un **soft Stop** :
- Chaque exécution incrémente un `execId` interne.
- Si une exécution se termine avec un `execId` obsolète, sa sortie est ignorée.
- Cela empêche les résultats périmés d’anciennes exécutions de polluer la console.

Tout cela se passe **dans le navigateur**, sans aucun appel à une API backend.

---

## 🚀 Bien démarrer

### 1. Prérequis
- [Docker](https://www.docker.com/) et [Docker Compose](https://docs.docker.com/compose/)

### 2. Construire et démarrer tous les 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. Tester :
```bash
docker compose -f docker-compose.test.yml up --build --exit-code-from frontend_test
```

---

# License
- Apache License 2.0
Loading
Loading