Class B Frameworks#

Class B frameworks are perfect for limited-scope projects, but don’t complain when you lack features!

Taipy#

Taipy is a strong Class B framework. The enterprise version could qualify as Class A because it supports authentication and authorization.

Resources and discussions#

github link “Taipy: an Open-Source Python Only Web App Builder Library”

Using PySpark with Taipy

Dara#

Dara is a very impressive offering which could easily be Class A but they have not demonstrated sessions and authorization and have not responded to numerous other questions.

The official description of Dara is “Build decision-making apps in Python” using interactive graphs and applications.

The documentation is copious and it looks like they will have a huge client base.

Trame#

Trame offers stunning visualization by seamlessly providing a Python API to a plethora of open source libraries such as Vuetify, Altair, Vega, deck.gl, VTK, ParaView, and more. It can also be deployed in a wide number of places from desktop to cloud.

Htag#

Htag is a very powerful and elegantly implemented pure-python-web-dev solution. It is the most recent solution by a prolific, talented and motivated author. He gained a lot of experience from his previous products, Gtag and Wyc.

The reason it is Class B is because it is a builder. A very flexible and powerful builder with the ability to be run in ALL of following deployment scenarios:

For a desktop app : You can use the PyWebView runner, which will run the UI in a pywebview container (or “ChromeApp runner”, in a local chrome app mode). For a web app : You can use the WebHTTP runner, which will run the UI in a web server, and serve the UI on client side, in a browser. For a android app : You can use the AndroidApp runner, which will run the UI in a kiwi webview thru tornado webserver, and can be embedded in an apk (recipes) For a pyscript app : you can use the PyScript runner, which will run completly in client side In fact any display portal which can render html/js/css, whether it be a browser, a pywebview, an android/apk, or anything based on cef, just needs an htag runner for htag to be able to render to it.

As the author states:

Yes … the promise is here : it’s a GUI toolkit for building “beautiful” applications for mobile, web, and desktop from a single codebase.

manatlan/htag

Demo#

A very impressive and expressive demo once it loads.

Discussions#

“Using htag to create a matplotlib app for desktop, web or mobile” “HTag : an IRL mobile app for android : a tricount clone … using py3“ HTag : A new GUI tookit for web/desktop/android from a single codebaseFirst frontend lib for pyscript ;-)” “htag 0.4.7 (a gui/frontend lib which works very well in pyscript)”

SimplePyDash#

SimplePyDash, according to the author, is a versatile, browser-based dashboard designed for real-time data plotting. With a focus on simplicity, it allows Python developers to easily visualize data streams without complex setup or dependencies.

Although originally developed to facilitate real-time plotting of OpenAI Gym environments for observing agent behavior, the versatility of SimplePyDash extends its utility beyond this use case, making it an excellent tool for many other data visualization scenarios.

Under the hood, SimplePyDash leverages the FastAPI web framework and uses WebSocket for bidirectional communication.

Highcharts for Python#

The Highcharts for Python Toolkit is a set of Python libraries that provide a Python wrapper for the Highcharts suite of JavaScript data visualization libraries, with full integration across the Python ecosystem.

The toolkit features native integrations with:

  • Jupyter Labs/Notebook. You can now produce high-end and interactive plots and renders using the full suite of Highcharts visualization capabilities.

  • Pandas. Automatically produce data visualizations from your Pandas dataframes

  • PySpark. Automatically produce data visualizations from data in a PySpark dataframe.

  • …and more library-specific integrations, including GeoPandas, PyShp, Topjson, Geojson, Asana, and more

Highcharts for Python provides Python object representation for all of the JavaScript objects defined in the Highcharts (JavaScript) API. It provides automatic data validation, and exposes simple and standardized methods for serializing those Python objects back-and-forth to JavaScript object literal notation.

Reacton – A pure Python port of React for ipywidgets#

ipywidgets is a library for writing interactive widgets in the Jupyter notebook.

Reacton is a pure Python library, that implements a similar API as ReactJS. Instead of rendering to the DOM, it renders to ipywidgets. The ipywidget library is then responsible for rendering in the front end (which could use ReactJS, Vue, or even jQuery).

Discussion#

initial reddit thread. “Advance your ipywidget app development with Reacton — A pure Python port of React for faster development”

Streamsync#

Let’s first see what streamsync has to say about itself:

Streamsync is an open-source framework for creating data apps. Build user interfaces using a visual editor; write the backend code in Python. Check out a live demo of an app.

Streamsync Builder screenshot

It’s fast.#

  • Streamsync enables significantly lower response times, when compared to Streamlit.

  • It only runs the user script once.

  • It uses WebSockets to keep frontend and backend states in sync.

It’s neat.#

  • Streamsync uses state-driven, reactive user interfaces. A data app’s user interface is strictly separated from its logic.

  • It uses a consistent yet customisable UI design system.

  • No caching needed; the script runs once and things remain in memory. You can use globals and module attributes to store app-wide data.

  • Predictable flow of execution. Event handlers are plain, easily testable Python functions. No re-runs, no strange decorators.

Documentation#

Documentation is available online at streamsync.cloud.

Now for my impressions#

Streamsync is not the first product to offer a visual UI for building apps. Anvil is a mature framework that offers that and is a Class A framework.

Anvil handles user sessions out of the box in a seamless fashion, Streamsync does not.

Datapane allows one to build data apps and it can be embedded in Flask or Django easily. Streamsync cannot.

Atri is a Class A framework that allows for visual UI building.

Resources and Discussion#

Gradio#

Gradio can wrap almost any Python function with an easy-to-use user interface. The function could be anything from image enhancer to a tax calculator but most commonly is the prediction function of a pre-trained machine learning model.

Gradio allows one to quickly create interfaces (either from the console or a Jupyter notebook or https://huggingface.co/spaces) and launch() them.

But it is also possible to customize how UI components look and/or behave.

From my perspective, the weaknesses are:

It is not clear how to integrate output from Gradio into a full-blown web-app. It offers password-based authentication only. No support for authorization

Shiny for Python#

Shiny for Python has a clean API and good documentation. Like many class B solutions, it lacks the features for complete web applications – authentication, authorization and sessioning.

The quickest way to get started is shinyapps.io, which is a hosted service for deploying Shiny applications. With shinyapps.io, you don’t need to set up a server; you just need to make an account on the site and then deploy the application there. Both free and paid tiers of service are available.

Shiny also has an experimental mode called Shinylive where you deploy to WebAssembly instead of a traditional client/server model.

I did not like the way that signals were handled in the CPU demo by needing to use invalidate_later but I dont have a better approach either.

The brownian motion example was quite impressive.

The verdict#

As already stated, it lacks the features for complete web applications – authentication, authorization and sessioning. Thus it is Class B.

Abstracloud#

Abstracloud reminds me of Gradio but with commercial restrictions. No on second thought, it reminds me of Anvil but with more commercial restrictions. The point is: they are entering the game late but costing more. The pricing model and non-FOSS distribution method seem to be a bit limiting. For instance, comparing their pricing model with Anvil’s, we see that we can have 50,000 data table rows in the free account at Anvil whereas any storage requires a jump up to the paid plan.

Publications#

https://www.reddit.com/r/Python/comments/wg13qr/lib_that_generates_web_uis_for_your_scripts_they/

###Deliverables https://www.reddit.com/r/Python/comments/wg4ml7/i_made_a_simple_weight_tracker_that_displays/

Neutron#

Neutron allows developers to build native Python apps along with CSS and HTML for frontend design. Based on pywebview for it’s native GUI window and JavaScript-Python communication.

Vue.Py#

Vue.py wraps Vue.js. Vue.py is based on Brython and the author is clear about what limitations that currently imposes. The lack of a gallery of applications and small userbase lead to this being a Class B solution.

JustPy – another Vue.js wrapper#

https://justpy.io/

Justpy frees the developer from being concerned about the difference between front-end and back-end development. From the README:

JustPy’s backend is built using:#

starlette – “a lightweight ASGI framework/toolkit, which is ideal for building high performance asyncio services”. uvicorn – “a lightning-fast ASGI server, built on uvloop and httptools“. JustPy’s frontend (which is transparent to JustPy developers) is built using:

Vue.js – “The Progressive JavaScript Framework” The way JustPy removes the frontend/backend distinction is by intercepting the relevant events on the frontend and sending them to the backend to be processed.

I would rate JustPy over Vue.py for a Vue solution based on apparent maturity. But neither provides solutions for the common issues of a fully mature web application framework.

A recent reddit post shows the commitment of the original author to long-term support of the project. That being said, the lack of response by the author did lead to a significant fork based of JustPy based on Svelte instead of Vue.js.

Built NiceGUI#

JustPy was the library underlying NiceGUI.

Publications:#

“justpy open source community is growing”

PyFyre#

And I plagiarize from the official Github:

Component-based framework. Developers who have experience in using other frontend frameworks should feel quite at home when using PyFyre. Truly reactive. PyFyre’s virtual DOM allows for simple and efficient state management. Quick navigation. Navigation between pages is quick with PyFyre’s single-page application design. Pythonic code with static typing. Developing with PyFyre is much easier with its type hinting and Pythonic style of coding. Asynchronous programming. Run non-blocking functions out of the box. CPython interoperability. Developers can limitedly use CPython packages on the client-side web. JavaScript interoperability. Allowing developers to leverage NPM packages and integrate with existing JavaScript applications. Pure Python. Build web apps without ever touching other languages like HTML and JavaScript. And more!

Discussions#

Python Frontend Framework for Building Websites

Built on Brython#

Transcrypt#

http://transcrypt.org/ is a Javascript generator that opts for integration with Javascript libraries instead of Python libraries. The book React to Python demonstrates how to use Transcrypt as the basis for full-blown applications. The sample gallery of applications is impressive. My personal nitpick is that they attempted to make some of numpy available within Transcrypt, breaking with their philosophy to leverage the Javascript ecosystem instead of Python. The clear separation of duties in a web application demands that they leave numpy and related libraries to a back-end API.

Nonetheless, Transcrypt is a polished mature product that anyone wishing the advantages of Python over Javascript is encouraged to use as a DSL for Js/Css/HTML.

By no means should you think every single aspect of CPython is available in Transcrypt: their docs tell you otherwise:

Note that Transcrypt avoids constructs that cannot be made to perform in the browser. This means that Transcrypt and CPython are playing in different leagues. Transcrypt makes it possible for Python programmers to take a lot of their skills to the browser, but it is in no way a replacement for CPython. The two should be regarded as complementary.

Transcrypt documentation.

Zython#

Zython is a webassembly project with a completely different implementation than python-wasm and pyodide, which are both based on emscripten and therefore suffer certain drawbacks that zython is not limited by.

The stated goal of the project is “…to create a WebAssembly build of the core Python and dependent packages, which runs both on the command line with Node.js and in the major web browsers (via npm modules that you can include via webpack). “

I find it unfortunate that the package name python-wasm ` is used in this project: it seems like it creates un-necessary confusion.

Discussions and articles#

official discussion forum https://www.reddit.com/r/Python/comments/xy4ah5/github_sagemathinczython_webassembly_python_for/

Bokeh#

With Bokeh, you can create JavaScript-powered visualizations without writing any JavaScript yourself. It is also possible to use Bokeh output in traditional frameworks like Django or Flask.

For me, the big question is: what good is a solution that is focused only on abstracting javascript visualizations? Aren’t there other things you can use Javascript for? Why would I choose this when I’m going to need another solution for other Javascript concerns?

The answer lies in the holoviz framework, which provides programmatic access to Bokeh and more.

pyodide#

https://pyodide.org/en/stable/

Python with the scientific stack, compiled to WebAssembly.

Pyodide may be used in any context where you want to run Python inside a web browser.

Pyodide brings the Python 3.9 runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, SciPy, and scikit-learn. Over 75 packages are currently available. In addition it’s possible to install pure Python wheels from PyPi.

Pyodide provides transparent conversion of objects between Javascript and Python. When used inside a browser, Python has full access to the Web APIs.

Building Block for#

It is what PyScript is built on.

Articles#

https://testdriven.io/blog/python-webassembly/

Contact#

https://pyodide.org/en/stable/project/about.html#communication

PyWebIO#

https://pywebio.readthedocs.io/en/latest/ is a builder with documented integration for Tornado, Flask, Django and aiohttp. It can also execute standalone. It is surprisingly procedural, yet offers decent support for nested rendering using functions instead of objects and methods.

Sample code#

Tokyo Olympics country’s performance ranking

Skulpt and Brython#

are both in-browser Python implementations. But they have different objectives as well as strength and weaknesses. Brython is faster. However Skulpt requires slower execution and load times because it aims for full python compliance. The objective of the products is different: Brython is aiming to be a replacement for Javascript while Skulpt aims to be a Python distribution that has a web browser execution target.

i found a nice chart on this site as well as this site. I dont know who is plagiarizing from who, but the table does give a nice overview of the various low-level solutions;

Building block for….#

Skulpt is what Anvil, a Class A pure-python-web-dev solution is based on.

PyWeb3D#

PyWeb3D allows you to use the three.js library without writing a JavaScript. As I voiced in my review of Bokeh, one wonders what to do when needing to abstract other aspects of Javascript/HTML/CSS.

Built on: Brython#

Articles and Applications “Meet PyWeb3D — Three.js With Python Syntax”

Brython#

https://brython.info/

Streamlit#

https://streamlit.io/ is very powerful and very popular, but adding features that you expect in a full-blown web app is hard and hackish or messy depending on who you talk to. However, apparently they have been bought out by Snowlake so they have a strong backing moving forward.

Discussions#

Streamlit-Powered Python Web Apps for Team Research

https://www.reddit.com/r/Python/comments/lnu1r9/i_made_a_covid19_immunityvaccination_tracker_and/

Articles#

Talk To Your CSV: How To Visualize Your Data With Langchain And Streamlit

How to Embed a Python Streamlit App in WordPress with Replit

“New Streamlit tutorial, 68 pages, 35 minimal app examples, focus on SQL+Streamlit”

“Build Real-time Data Applications Quickly Using Streamlit And Prisma“

https://analyticsindiamag.com/streamlit-vs-plotlydash-comparison-with-python-examples/

“I was excited about YOLOv7, so I built a sharable object detection application with VDP and Streamlit.“

“Streamlit User and API Authentication with Auth0 Next.js SDK‘

Resources#

Streamlit Login/ Sign Up Library Streamlit Reddit Channel Streamlit Community Cloud - Deploy, manage, and share your apps with the world, directly from Streamlit — all for free. Streamlit forum