PyScript First Impressions
May 15, 2022
PyScript is this awesome new tool that combines the browser with python, was released by the wonderful team at Anaconda, and represents a paradigm change in browser capability. I recently spent a number of hours testing it out and even got PyMC to run (with some effort). Longer thoughts below, but let's start wth the summary.
If you're totally new to Python: PyScript is very cool but not ready day to day use yet. Use something like Anaconda if you can install stuff locally, or repl.it, Binder, or Colab if you can't.
If you're an educator: This is going helpful in two ways. First it'll smooth environment setup issues. Ideally eliminate it, students can just open a html file and get going. The second is in access low to no internet environments, since all the code is client side it can load from a local file!
If you're a data Professional: This is going to change the game. Currently, Plotly/Plotly Dash are the most current analogous solutions, but both require hosting and take a "server side" approach. PyScript takes a "client side, no server needed" approach which is huge shift.
If you're an OSS contributor: Get your packages working on Pyodide ASAP. As Peter explains in his talk your potential userbase will increase by over 10x
The best source fo details is the GitHub repo or the PyCON PyScript keynote
My test code is here, and you can watch me code the whole thing
What is Pyscript
From the README
PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers.
The way I see it
- It's a way to get Python and other languages in front of people in an interface everyone is familiar with (nearly) no install fuss
- A flexible tool to share and communicate data with professional colleagues, particularly ones outside of my technical team
- A way for me to leverage the power of the internet and browser, in programming languages I'm comfortable with
Current state and how you can help
As prominently displayed it's in an alpha state. However the Anaconda team is openly inviting contributors. If you're a developer download the code and try it out, then either contribute directly to PyScript and its associated libraries (Pyodide and micropython) or port other packages to the ecosystem.
In the coming days I will add a section to this post with more in depth advice and tips.
Other Takes
Eric Ma has a great writeup and embedded example with NetworkX which you should check out. As I see more I'll append to this list