PyScript: An open source platform for Python in the browser
PyScript is an open-source platform that allows users to run Python in web browsers, enabling easy app development, scalability, security, and accessibility through URL sharing, democratizing programming for a wider audience.
Read original articlePyScript is an open-source platform that allows users to run Python directly in web browsers, merging the capabilities of the web with the popular programming language. It aims to empower users by providing a familiar and accessible computing environment. PyScript is designed to be easy to use, requiring no complex installation processes, and allows developers to create applications using Python, which is known for its simplicity and expressiveness. The platform is scalable, as applications run in the user's browser without the need for costly infrastructure. Additionally, PyScript applications can be easily shared via URLs, making them universally accessible. The platform emphasizes security by operating within the browser, which is considered a robust computing environment. Overall, PyScript represents a significant step in making Python more accessible and functional for web development.
- PyScript enables running Python in web browsers without complex installations.
- It combines the strengths of Python and web technologies for app development.
- Applications created with PyScript are easily shareable via URLs.
- The platform is scalable and secure, leveraging the browser's capabilities.
- PyScript aims to democratize programming by making it accessible to a wider audience.
Related
HTML-ivating your Django web app with Htmx, AlpineJS, and streaming HTML
The video discusses concerns over the prevalence of single page applications online, promoting traditional server-based websites. It recommends Django over React, demonstrating fast website creation and speed optimization techniques.
Beyond Hypermodern: Python is easy now
Python development in 2024 focuses on simplicity with tools like Rye aligning with packaging standards. It streamlines setup, dependency management, and project structuring, emphasizing typing with Pyright for efficient code maintenance and pytest for testing.
SimPy is a process-based discrete-event simulation framework in Python
SimPy is a Python framework for discrete-event simulation, modeling active components and shared resources. It supports various simulation speeds and includes extensive documentation, tutorials, and community resources. The current version is 4.1.1.
Making Your Documentation Interactive with PyScript PyCon
Jeff Glass presented "Make Your Documentation Interactive with PyScript" at PyCon US, focusing on enhancing documentation interactivity. Attendees can access slides, demos, and resources for further exploration.
Slingcode – App platform in a single HTML file, QR-code transmittable apps
Slingcode is an offline personal computing platform enabling users to create, run, and share web applications without servers. It supports peer-to-peer sharing and aims to simplify coding for beginners.
- Users share practical use cases, such as creating dashboards and applications, highlighting its potential for web development.
- Some express confusion about its purpose and functionality, comparing it to other tools like Pyodide and Brython.
- Concerns are raised about the complexity and performance, with some noting slow execution times and challenges with dependencies.
- There are discussions about the implications for developers, including potential maintenance issues and the impact on coding practices.
- Several users suggest alternatives or express skepticism about PyScript's effectiveness compared to established frameworks like React.
https://crimede-coder.com/graphs/Dallas_Dashboard
Startup takes around a minute (which includes installing various python libraries + loading an external 5mb dataset). But once up and running it is quite responsive. (And works fine on my iphone.)
Many businesses I work with use Tableau free versions, and just manually update the data (since the free doesn't allow direct connections to a datastore). This is a free alternative (I use github actions to build a zipped up csv file that is pulled into the environment).
I tinkered a bit to try it myself.
Turns out you can throw this into your website and it will display "Hello World":
<script type="module" src="https://pyscript.net/releases/2024.8.2/core.js"></script>
<script type="py">
import js
js.document.querySelector("body").innerText = "Hello World"
</script>
So it seems to be a script that looks for scripts of type "py" and transpiles them from Python to JavaScript via Pyodide?On the other hand, the demo on the homepage is a repl. And the title says "platform". So I'm still confused.
It felt hacky the whole time, especially when dependencies were involved. I had to create wrapper classes to work around Pydantic 2.x not being available to use. I tried to put all logic into the Python files but found some things missing that I had to put in JavaScript.
I think it could be good in use cases where you want some simple UI with custom UI logic on top of your Python code but maybe Streamlit or Gradio could be more suitable.
GitHub repo: https://github.com/data-catering/data-contract-playground
Website: https://data-catering.github.io/data-contract-playground/
Is there something which can do this? and with full power of python also accessible to the host?
The app won't run well on mobile but should be fine on desktop.
I used this code in a blog application I was writing in Django.
I have a lightweight hack [1] that runs Python in markdown documents and can output basic images/graphs - which is embedded into static pages. The point was being able to write an article that somebody else could see the code behind it and test themselves, e.g. [2]. One of the browsers I test in is Netsurf with JS disabled. Unfortunately it doesn't look great in Lynx.
[1] https://gitlab.com/danbarry16/pandoc-highlight-filter
[2] https://coffeespace.org.uk/projects/langtons-ant-universe.ht...
PyScript is currently built on Pyodide, which is a “port of CPython to WebAssembly/Emscripten.” PyScript supports writing and running Python code in a browser.
Like conda I find the whole thing very confusing and slow, but I suppose it will be marketed to academics as "the thing to do web development with". It will also be soft-abandoned.
Just use Javascript, PHP or Scala like lichess.org, which is a professional website.
It supports streamlit, dash, virzo and solara. Frameworks like shiny, gradio and panel are planned (maybe even fasthtml).
It's also really nice to integrate this into your documentation: https://mkdocs.py.cafe/
https://n8henrie.com/2023/06/write-a-firefox-extension-in-py...
First it was untrained consultants and VB or Delphi (Pascal)
Then came the JS monkeys mixing up plain JS with jQuery and SQL injections.
Now it's time for data scientists and pi/sketch users to feel the pain of an uncharted domain...
Related
HTML-ivating your Django web app with Htmx, AlpineJS, and streaming HTML
The video discusses concerns over the prevalence of single page applications online, promoting traditional server-based websites. It recommends Django over React, demonstrating fast website creation and speed optimization techniques.
Beyond Hypermodern: Python is easy now
Python development in 2024 focuses on simplicity with tools like Rye aligning with packaging standards. It streamlines setup, dependency management, and project structuring, emphasizing typing with Pyright for efficient code maintenance and pytest for testing.
SimPy is a process-based discrete-event simulation framework in Python
SimPy is a Python framework for discrete-event simulation, modeling active components and shared resources. It supports various simulation speeds and includes extensive documentation, tutorials, and community resources. The current version is 4.1.1.
Making Your Documentation Interactive with PyScript PyCon
Jeff Glass presented "Make Your Documentation Interactive with PyScript" at PyCon US, focusing on enhancing documentation interactivity. Attendees can access slides, demos, and resources for further exploration.
Slingcode – App platform in a single HTML file, QR-code transmittable apps
Slingcode is an offline personal computing platform enabling users to create, run, and share web applications without servers. It supports peer-to-peer sharing and aims to simplify coding for beginners.