Use cases for Pyscript?

introduction of pyscript is quite exciting. but I am wondering if there are any thoughts and ideas what larger avenues this opens (like more big picture).

  1. In general for FE, What use cases do likely something like pyscript may shine? could it for some project get away with just using pyscript and no javascript?
  2. areas that pyscript will never be that great suited for?

pyscript & pyiodide is quite an impressive feat to have python in browser and just wondering if anyone has any insights what this could mean for FE development and such as whole. potential some cool use cases that open up, etc?

I personally rather to make my project up with Python (Back and front) and then if it works, give it to technical team to make professional work out of it.

There are three areas that I think PyScript will succeed with:

  • AI
  • ML
  • Data Science

Those areas have large ecosystems with millions (billions?) of lines of code written in Python.

I do not see PyScript as a frontend GUI tool. The ecosystem for JavaScript and frameworks are very large and also well established. It is easy to write to the DOM in PyScript, but there is no benefit over JavaScript.

Years ago, serverless deployments were all the range. Services like AWS Lambda were talked about everywhere. The processing requirements of Python-based AI, ML and Data Science can now be redistributed to the desktop because of PyScript. This has the potential to reimagine, once again, how services are deployed in the cloud and the data center.

For now, consider PyScript just another tool in your developer toolbox. Just like a carpenter has multiple hammers, so should developers. We can then select the best tool to meet our objectives instead of being forced to use only one language/framework/library. The browser along with WASM will bring new features that are just now being imagined.

Hi John, I think there are a few great usecases atleast to what I can think:

  1. COGS reduction - Reduce cost of servers by having costly data crunching operations on client end.

  2. Privacy - pyscript can demo how not to copy user data on server and instead do all the analysis for user on their device.

  3. Diversity - Since pyscript can go directly into HTML, it can be pushed via webviews into a plethora of apps, think of chrome extensions, apps for TV, mobiles, etc.

I also wrote a ~2 min read blog on this. The only (and really big) think that needs to improve is speed!

1 Like

I spend most of my time designing very large systems in the cloud. Your item #1 is of interest to me as I can see browser-based processing power affecting how we design backend services. Moving CPU processing from a server handling hundreds of clients to the clients themselves will increase the number of clients each server can manage. AI, ML, etc consume large numbers of CPU cycles. The more CPU cycles moved to the browser, the large the impact.

1 Like