Skip to content

Features

All the web

Pyscript gives you full access to the DOM and all the web APIs implemented by your browser.

Thanks to the foreign function interface (FFI), Python just works with all the browser has to offer, including any third party JavaScript libraries that may be included in the page.

The FFI is bi-directional ~ it also enables JavaScript to access the power of Python.

All of Python

PyScript brings you two Python interpreters:

  1. Pyodide - the original standard CPython interpreter you know and love, but compiled to WebAssembly.
  2. MicroPython - a lean and efficient reimplementation of Python3 that includes a comprehensive subset of the standard library, compiled to WebAssembly.

Because it is just regular CPython, Pyodide puts Python's deep and diverse ecosystem of libraries, frameworks and modules at your disposal. No matter the area of computing endeavour, there's probably a Python library to help. Got a favourite library in Python? Now you can use it in the browser and share your work with just a URL.

MicroPython, because of its small size (170k) and speed, is especially suited to running on more constrained browsers, such as those on mobile or tablet devices. It includes a powerful sub-set of the Python standard library and efficiently exposes the expressiveness of Python to the browser.

Both Python interpreters supported by PyScript implement the same FFI to bridge the gap between the worlds of Python and the browser.

AI and Data science built in
Python is famous for its extraordinary usefulness in artificial intelligence and data science. The Pyodide interpreter comes with many of the libraries you need for this sort of work already baked in.
Mobile friendly MicroPython

Thanks to MicroPython in PyScript, there is a compelling story for Python on mobile.

MicroPython is small and fast enough that your app will start quickly on first load, and almost instantly (due to the cache) on subsequent runs.

Parallel execution
Thanks to a browser technology called web workers expensive and blocking computation can run somewhere other than the main application thread controlling the user interface. When such work is done on the main thread, the browser appears frozen; web workers ensure expensive blocking computation happens elsewhere. Think of workers as independent subprocesses in your web page.
Rich and powerful plugins

PyScript has a small, efficient yet powerful core called PolyScript. Most of the functionality of PyScript is actually implemented through PolyScript's plugin system.

This approach ensures a clear separation of concerns: PolyScript can focus on being small, efficient and powerful, whereas the PyScript related plugins allow us to Pythonically build upon the solid foundations of PolyScript.

Because there is a plugin system, folks independent of the PyScript core team have a way to create and contribute to a rich ecosystem of plugins whose functionality reflects the unique and diverse needs of PyScript's users.