How it works
Pyodide is CPython compiled to WebAssembly with Emscripten. A page loads it from a CDN or your own server and then runs Python code, and Python and JavaScript can call each other and pass objects back and forth. Pure-Python packages install from PyPI with micropip, and many packages with compiled parts (NumPy, pandas, SciPy, Matplotlib, scikit-learn) are pre-built for it. It also runs in Node.js and in web workers, which keeps long jobs from freezing the page.
It powers JupyterLite notebooks, PyScript, and many teaching sites and code playgrounds, where running code on the visitor's own machine avoids maintaining a server-side sandbox. The costs are a download of several megabytes before the first line runs, slower execution than native Python, and limited support for threads and network sockets.