| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
What is Pyodide? | Try Pyodide | Getting Started | Contributing | License
The Python scientific stack, compiled to WebAssembly.
Try Pyodide and Iodide in your browser
Pyodide brings the Python runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, parts of SciPy, and NetworkX. The packages directory lists over 35 packages which are currently available.
Pyodide provides transparent conversion of objects between Javascript and Python. When used inside a browser, Python has full access to the Web APIs.
While closely related to the iodide project, a tool for literate scientific computing and communication for the web, Pyodide goes beyond running in a notebook environment. To maximize the flexibility of the modern web, Pyodide may be used standalone in any context where you want to run Python inside a web browser.
For more information, try the demo and look through the documentation.
Pyodide offers three different ways to get started depending on your needs and technical resources. These include:
Pre-built versions of Pyodide may be downloaded from this repository's releases page.
Building is easiest on Linux and relatively straightforward on Mac. For Windows, we currently recommend using the Docker image (described below) to build Pyodide.
Make sure the prerequisites for emsdk are installed. Pyodide will build a custom, patched version of emsdk, so there is no need to build it yourself prior.
Additional build prerequisites are:
On Mac, you will also need:
After installing the build prerequisites, run from the command line:
makeWe provide a Debian-based Docker image on Docker Hub with the dependencies already installed to make it easier to build Pyodide. Note that building from the Docker image is very slow on Mac, building on the host machine is preferred if at all possible.
Install Docker
From a git checkout of Pyodide, run ./run_docker
Run make to build.
If running make deterministically stops at one point in each subsequent try, increasing the maximum RAM usage available to the docker container might help [This is different from the physical RAM capacity inside the system]. Ideally, at least 3 GB of RAM should be available to the docker container to build pyodide smoothly. These settings can be changed via Docker Preferences [See here].
You can edit the files in your source checkout on your host machine, and then repeatedly run make inside the Docker environment to test your changes.
Please view the CONTRIBUTING document for tips on filing issues, making changes, and submitting pull requests. The following sections describe how to run tests, run Pyodide benchmarks, and lint the source code.
Install the following dependencies into the default Python installation:
pip install pytest selenium pytest-instafailInstall geckodriver and chromedriver and check that they are in your PATH.
To run the pytest suite of tests, type on the command line:
pytest test/ packages/To run manual interactive tests, a docker environment and a webserver will be used.
Bind port 8000 for testing. To automatically bind port 8000 of the docker environment and the host system, run: ./run_docker
Now, this can be used to test the pyodide builds running within the docker environment using external browser programs on the host system. To do this, run: ./bin/pyodide serve
This serves the build directory of the pyodide project on port 8000.
Once the webserver is running, simple interactive testing can be run by visiting this URL: http://localhost:8000/console.html
To run common benchmarks to understand Pyodide's performance, begin by installing the same prerequisites as for testing. Then run:
make benchmarkPython is linted with flake8. C and Javascript are linted with clang-format.
To lint the code, run:
make lintPyodide uses the Mozilla Public License Version 2.0. See the LICENSE file for more details.
What is Pyodide? | Try Pyodide | Getting Started | Contributing | License | Back to top
| Back | FazBrowse Home | New Git URL |