Article complete

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.

Anaconda brings out PyScript: Python in your browser

Key takeaways

  • Anaconda has launched PyScript, enabling users to run Python applications directly in web browsers.
  • PyScript integrates Python with standard HTML, enhancing web application development capabilities.
  • The framework supports popular Python packages such as NumPy, pandas, and scikit-learn for scientific computing.
  • PyScript facilitates bi-directional communication between Python and JavaScript, expanding functionality for developers.
  • Users can customise which packages and files to include, allowing for flexible and extensible component creation.

Takeaways drafted with AI from the article text.

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

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. 

https://twitter.com/HamelHusain/status/1520585242116980736
https://twitter.com/soumithchintala/status/1520463134741389314
https://twitter.com/tunguz/status/1521095469774086145

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

Published

Spotted an error? Tell our editors. Read our editorial standards and corrections.