Anaconda brings out PyScript: Python in your browser
“Python in a browser” is here!- Yes, you read that right. At PyCon US 2022, Anaconda, Inc. has introduced PyScript, which allows users to create Python applications in the browser by using a mix of Python with standard HTML. https://twitter.com/anacondainc/status/1520447158603890691 Anaconda, Inc. was founded by Peter Wang and Travis Oliphant around a decade ago. The company is behind the release of Anaconda, a distribution of the Python and R programming languages for data science, ML, predictive analytics, etc. In a blog, Fabio Pliger, principal architect at Anaconda, Inc., discussed PyScript in detail. He mentioned that PyScript allows a user to run many popular packages of Python and the scientific stack like NumPy, pandas, scikit-learn, etc. It will also provide bi-directional communication between Python and JavaScript objects and namespaces. Finally, it will allow the users to define what packages and files to include for the page code to run and provide a flexible framework that can be used to create and share new pluggable and extensible components directly in Python. Pliger adds, “The core concept of PyScript, as a framework, is to provide a set of [opinionated] components and tools that allow users to quickly create and share their applications. We also don’t want to reinvent the wheel and aim to re-use the great work that many others are already doing.” Reactions PyScript has received positive feedback from data scientists, developers and tech enthusiasts as of now. Nir Barazida, data scientist at DAGsHub, adds, “I think PyScript is a game-changer. It opens a world of possibilities to Python programmers and machine learning practitioners in particular. We can now easily wrap our models in HTML applications, share them with the world and have the end-users run them on the browser.” WOW! You can also render Altair charts directly in the browser with pyscript My head is going to explode with all the amazing possibilitieshttps://t.co/o87LCSXyUb pic.twitter.com/76mLQTvUwR— Hamel Husain (@HamelHusain) May 1, 2022 Excited to see https://t.co/OhatkRLd0H from @anacondainc A well-supported effort to put Python in the browser has so much benefit.Immediately, the powerful Dashboards and ipython widgets which we write in Javascript today can and should be moved to Pyscript— Soumith Chintala (@soumithchintala) April 30, 2022 This past weekend there was a major announcement by the @anacondainc team at #PyCon2022 – the launch of PyScript, an in-HTML interface for Python. This is something that many of us in the Python community have been hoping for for a long time. #Python #Web #Programming1/6 pic.twitter.com/e81H58VSZg— Bojan Tunguz (@tunguz) May 2, 2022 Sachin Birla, senior consultant at EY, says, “Data scientists will be a big beneficiary of PyScript. Most of the time, data scientists prepare models but cannot make them representable to stakeholders. PyScript will enable them to use the full potential of their capabilities and thought processes. Most of the models and charts are not even consumable by targeted audiences just because of the lack of proper UI, but PyScript might play a crucial role in overcoming all shortcomings. It will boost the productivity of the data science team and reduce expenses of organisations to hire frontend team.” Tech stack behind it Pliger, in the same blog, also discusses many elements behind this offering. These include: WebAssembly (WASM) – WASM is a binary instruction format for a stack-based virtual machine, designed as a portable compilation target for programming languages that helps in deployment on the web for client and server applications. Emscripten – It is a complete compiler toolchain to WebAssembly, using LLVM, with a special focus on speed, size, and the Web platform. Image: Anaconda, Inc. Pyodide – It is a Python distribution for the browser and Node.js based on WebAssembly. With this, we can install and run Python packages in the browser with micropip. Many packages with C extensions have also been ported for use with Pyodide. It includes many general-purpose packages like RegEx, PyYAML, lxml and Python packages, including NumPy, pandas, SciPy, Matplotlib, and scikit-learn. Opportunities PyScript has the potential to be as popular as Javascript in the web developer community. Sachin lists down some opportunities PyScript can bring in: Narrow down the need for language set: Web developers need a diverse set of programming languages, such as HTML, JavaScript and any backend language like Java or Python. PyScript subsumes to learn such skills.Create new roles and opportunities: Syntax of Python is so easy, and anyone can learn and understand it quickly. So, many new entrants will be attracted to it.Scope of cutting edge innovation: Many innovative products don’t take shape just because people are not exposed to frontend language.Explore new dimensions of AI: Python is the default language for AI/ML solutions. PyScript can create a new milestone in the field of AI, which has not been explored yet. Sachin adds, “It’s a new offering. It might face adaptation issues in the development community. Compared to JavaScript, it lacks in large public libraries.”
A user can run many popular packages of Python and the scientific stack like NumPy, pandas, scikit-learn, etc.
PyScript allows a user to run many popular packages of Python and the scientific stack like NumPy, pandas, scikit-learn, etc.
["HTML", "Python"]
["data science", "scikit-learn", "NumPy", "machine learning", "AI", "ML", "HTML", "Python", "Aim", "analytics", "Matplotlib", "Pandas"]
["AI", "machine learning", "ML", "data science", "analytics", "Aim", "scikit-learn", "Pandas", "NumPy", "Matplotlib"]
I am a technology journalist at AIM. What gets me excited is deep-diving into new-age technologies and analysing how they impact us for the greater good.

Reach me at sreejani.bhattacharyya@analyticsindiamag.com