Overview
This app is an initial exploration into shiny for Python which was revealed at rstudio::conf(2022) earlier this summer.๐๐๐Aim
The aim of the exploration was to try out the API and see whether I can recreate common patterns/functionalities I use in my other apps.
The app is simple: Use the sample data (or upload your own) to run a basic linear regression analysis and display the resulting plot.
Functionalities
Here are the functionalities covered in the app:
- โ custom CSS (could you tell?) ๐คฃ
- โ data processing (file upload and external files)
- โ creating reactive objects
- โ rendering UI, plots, etc
- โ
validation with
req()
Deployment
I currently have my app running on shinylive.io which seems to be a very promising serverless solution. You can also build your app as a static site (locally) and serve it via github pages or netlify.๐คฏ๐คฏ๐คฏ๐View the app + code in editor mode: make changes and execute it all within the browser See Here๐
The one downside is that not all libraries are supported, which is understandable. I originally used the
xport library to read SAS .xpt files instead of .csv files in development. Winston Changโs talk provides more detail about this and the technology in general.Future
If and when this is included (or I figure out the rsconnect deployment, which is also an option by the way), the following code can be replaced easily to read .xpt
import xport
def p():
if input.file1() is None:
return "Please upload a csv file"
f: list[FileInfo] = input.file1()
with open(f[0]["datapath"], 'rb') as z:
df = xport.to_dataframe(z)
Thatโs about it. I plan to do a blog post summarizing the experience further and my thoughts around the news of Rstudioโs โmoveโ into the Python space later.
๐ปโ