I only recently learned about streamlit and think it looks great! I am wondering about two potential features that are either already implemented somehow or might be in a pipeline. I realize Streamlit is somewhat analogous to Shiny, but I am thinking from the perspective of someone performing ad hoc data analyses or report generation.
Is it possible to export the page as a “standalone” HTML file or pdf etc. for the generation of reports? Bokeh/plotly allow this through embedding of necessary scripts etc.
Would it be possible to implement something like an RMarkdown mode? Instead of a Python source file that is consumed, streamlit would consume a Markdown file containing fenced code blocks.
Definitely looking forward to using streamlit in my own projects!
As I see it implementing something like 2. would be doable. I’ve actually been thinking about it. I think that kind of mode would be very usuable when you do more (technical) writing than coding. I imaging that it should be “easy” to create a script to convert RMarkdown to Streamlit Python that can then be run by Streamlit.
@Marc’s responses are totally right (thanks @Marc!), but I just wanted to add some more info:
Is it possible to export the page as a “standalone” HTML file or pdf etc. for the generation of reports? Bokeh/plotly allow this through embedding of necessary scripts etc.
You have two options today:
You can save a “snapshot” of your app to AWS S3 (if you have your own S3 account). See this for instructions
You can use your browser’s “print” dialog the Streamlit app to PDF!
(Except this is actually broken right now, but we just merged a fix into the develop branch. So it will be fixed in the next Streamlit release in a week or two)
Also, we’re considering extending (1) to allow you to write to a local folder rather than only S3. See the feature request here. Please upvote it over there if you think this would be useful, or add comments if you have ideas on how it should work!
Would it be possible to implement something like an RMarkdown mode? Instead of a Python source file that is consumed, streamlit would consume a Markdown file containing fenced code blocks.
As @Marc said, this is not supported today. But you can do the opposite: you can write Markdown inside a Python file. The end result is actually quite similar:
This is what you want to do, but Streamlit does not support today:
[Filename: hello.md]
```
import streamlit as st
```
Hello **world!**
```
x = st.slider("Pick a number!")
```
Here's what you selected:
```
x
```
And here’s what you can do with Streamlit today:
[Filename: hello.py]
import streamlit as st
"""
Hello **world!**
"""
x = st.slider("Pick a number!")
"""
Here's what you selected:
"""
x
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.