Skip to content

Code to experiment how files can be passed between Pyodide and Javascript

Notifications You must be signed in to change notification settings

trbKnl/Pyodide-Javascript-Filehandeling

Repository files navigation

Minimal Pyodide testing code

This code can be used for experimentation and for prototyping DDP parsing development. You can use this code to experiment with loading Pyodide packages: check worker.js

It works as follows:

sequenceDiagram
    participant J as Javascript
    participant P as Pyodide
    Note left of J: FileReader API with readAsArrayBuffer()
    J->>P: Send files in an Array containing ArrayBuffers 
    Note right of P: ArrayBuffers to io.BytesIO()
    loop Process io.BytesIO objects
       P->>P: process io.BytesIO() accordingly
    end
    P->>J: Send data back in a tbd format

Usage

All code is in index.html for convenience except the pyodide API and the worker.

Host with:

python3 -m http.server 8000 --bind localhost

About

Code to experiment how files can be passed between Pyodide and Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published