MITB Banner

Anaconda brings out PyScript: Python in your browser

A user can run many popular packages of Python and the scientific stack like NumPy, pandas, scikit-learn, etc.

“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.”

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.”

Access all our open Survey & Awards Nomination forms in one place >>

Picture of Sreejani Bhattacharyya

Sreejani Bhattacharyya

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

Download our Mobile App

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

3 Ways to Join our Community

Telegram group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our Daily newsletter

Get our daily awesome stories & videos in your inbox
Recent Stories