marp | theme | paginate | transition | _class | backgroundColor | backgroundImage |
---|---|---|---|---|---|---|
true |
gaia |
true |
slide |
lead |
- our team have a few (two?) R Shiny apps
- intended for non-technical users, but have had difficulty in making them accessible
- https://pyscript.net/
- PyScript lets you create a frontend web application using Python.
- Either
- embed Python code in HTML print('Hello World!') | , or
- link to a Python file and the code will run in the browser.
- developed by Anaconda people
PyScript sits on top of:
-
pyodide: Python ported to ...
- WebAssembly: open standard for executing fast binary code in web apps.
-
pyodide packages include:
- numpy, pandas, scipy, scikit-learn
- matplotlib, bokeh, ...
- and can use any pure Python packages from PyPi
- one of our shiny apps converted to Python, using Panel for widgetty things. https://panel.holoviz.org/
- https://github.com/Treasury-Analytics-and-Insights/pyscript_experiment
- an "Action" in the github repo publishes the app to github-pages whenever the main branch is updated
- I think I just clicked a button in github to enable github-pages for the repo, and then added the Action by clicking "new Action" and selecting the "publish to github-pages" template. I didn't have to write any code for the Action.
- this github free account plus github-pages treatment is only suitable for non-sensitive data
- if your app needs to import data from file, you can't just email the html and supporting files to someone, they need to run a local web server. For security, web browsers can't access local files without user permission. There are probably ways around this, but I haven't looked into it.