TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Streamlit: Turn a Python script into an interactive data analysis tool

470 pointsby danicgrossover 5 years ago

35 comments

_gwlbover 5 years ago
This looks really slick, can&#x27;t wait to try it out!<p>If anyone is curious about other tools in the same space, our data scientists use Dash[1] and plotly to build interactive exploration and visualization apps. We set up a Git repo that deploys their apps internally with every merge to master, so they&#x27;re actually building and updating tools that our operations, marketing, etc teams use every day.<p>[1] <a href="https:&#x2F;&#x2F;plot.ly&#x2F;dash&#x2F;" rel="nofollow">https:&#x2F;&#x2F;plot.ly&#x2F;dash&#x2F;</a>
评论 #21170265 未加载
评论 #21171677 未加载
random42over 5 years ago
Interesting project, but why does an open source developer tool needs browser telemetry?<p>You should ask for telemetry permissions _before_ the process starts up (as you do for email address), and keep the default as &quot;No&quot;, instead of start to send the data transparently unless non user friendly steps are taken by the user.
iandanforthover 5 years ago
This is a declarative programming model similar to React. I&#x27;m surprised the analogy isn&#x27;t drawn in the article.<p>&quot;Streamlit assigns each variable an up-to-date value given widget states.&quot;<p>This line is interesting because it implies distributed state in each component (widget). Alternatively this could be framed in centralized state manager terminology.<p>&quot;Each widget is provided with the current state of the application, and that state is also available to your script.&quot;<p>If you adopt this mindset you can separate the concerns of state and presentation. At first glance it appears that you need to extract state from widgets at the same point as they are added to the page.<p>(Please correct me if I&#x27;m wrong.)<p>I might not want to have a widget added to a page until much later in the script, but I want to have access to its state at the top of the script.<p>The value of the top level `props` parameter to a react component is it gives you access to all state wherever you need it, and disentangles this state from the arrangement of the page.
评论 #21172849 未加载
simonwover 5 years ago
I&#x27;m impressed.<p>Installing on my Mac to test this out was very straight-forward:<p><pre><code> cd &#x2F;tmp mkdir streamlit cd streamlit pipenv shell pip install streamlit </code></pre> Then I could play with the built-in demos by running:<p><pre><code> streamlit hello </code></pre> So that was a slick intro - next step was I followed this tutorial: <a href="https:&#x2F;&#x2F;streamlit.io&#x2F;docs&#x2F;tutorial&#x2F;create_a_data_explorer_app.html" rel="nofollow">https:&#x2F;&#x2F;streamlit.io&#x2F;docs&#x2F;tutorial&#x2F;create_a_data_explorer_ap...</a><p>And a few minutes later I had an interactive notebook-style interface for playing with Uber pickup data in New York.<p>This is a really interesting product.
评论 #21173860 未加载
ttulover 5 years ago
I am a terrible data scientist. I look forward to this tool making me look like I know what I’m doing.
yardshopover 5 years ago
I gave it a try on Windows and ran into an issue, but found a workaround.<p>I&#x27;m using WinPython 3.6 on Windows 7. I did &quot;pip install streamlit&quot; and then &quot;streamlit hello&quot;, and had to allow it through the firewall, then got a 404 page.<p>The workaround is very simple, just use the provided http address and add &quot;index.html&quot;:<p><pre><code> http:&#x2F;&#x2F;localhost:8501&#x2F;index.html </code></pre> This link has more info: <a href="https:&#x2F;&#x2F;github.com&#x2F;streamlit&#x2F;streamlit&#x2F;issues&#x2F;244" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;streamlit&#x2F;streamlit&#x2F;issues&#x2F;244</a>
评论 #21218151 未加载
77koover 5 years ago
Whats the easiest way to make public on the internet a small streamlit powered analysis?<p>I saw there is a Streamlit for teams in the future (sounds expensive) and on the forums they recommended to make a docker container and host it anywhere, which is doable, but I&#x27;d love a way to be able to just put something up on the internet for a short period of time, sort of how now.sh[1] works.<p>[1]: <a href="https:&#x2F;&#x2F;zeit.co&#x2F;home" rel="nofollow">https:&#x2F;&#x2F;zeit.co&#x2F;home</a>
评论 #21174402 未加载
diskmuncherover 5 years ago
I am not sure &quot;rerunning the script from top to bottom&quot; is a necessary condition but for the code layout to reflect the expected behavior.<p>How would people compare this to Observable [1]? 1. Javascript vs. Python 2. Client-only vs. server-required?<p>Does the market already give advantage to Python and server-required because the data sets are too large and live on the server, and the users (data scientists) prefer Python and the existing libraries there?<p>[1]: <a href="https:&#x2F;&#x2F;observablehq.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;observablehq.com&#x2F;</a>
xiaodaiover 5 years ago
It&#x27;s like embedding Shiny apps into RMarkdown<p><a href="https:&#x2F;&#x2F;bookdown.org&#x2F;yihui&#x2F;rmarkdown&#x2F;shiny-embedded.html" rel="nofollow">https:&#x2F;&#x2F;bookdown.org&#x2F;yihui&#x2F;rmarkdown&#x2F;shiny-embedded.html</a>
kfkover 5 years ago
I agree on the premise: yes eventually every analysis needs to become an app. Also let me add: no, dashboards are not going to cut it, they don&#x27;t offer enough interactivity. I also love that the app here is a script and hence can be version controlled with git. However, there is no description anywhere of what happens when you need to scale with this. If you have to go from a couple of testers to 100 internal users like it very often happens in analytics, how does this react?<p>Also caching is a great idea but I would expect a lot of this logic to be managed on the server side, or I am missing something and ML is different here? I would expect to pipe as little data as possible back to the application because I want the user to wait max 3-4 seconds for the app to load at start.
评论 #21178536 未加载
jonjleeover 5 years ago
Apart from ML, this could be very useful for creating dashboards in the healthcare setting. Dashboards are surprisingly had to make, deploy, and maintain in the hospital. I&#x27;ve created many one-off webapps for different research groups and have been dreaming of a tool that consolidates all the front end work allowing me to concentrate how to process the data. Streamlit looks incredible for this!
评论 #21173001 未加载
评论 #21172384 未加载
ignoramus23over 5 years ago
This is awesome! Is there a way to generate a standalone binary, e.g. as an electron app? I&#x27;m looking for ways to ship small custom python&#x2F;pandas data analysis apps including data to non-technical users - but as a local application.
评论 #21171218 未加载
sandGorgonover 5 years ago
This is spectacular. I have written about this many times on HN itself .<p>Jupyter -&gt; internal tool&#x2F;API is pretty much the holy grail of bridging data scientists, business teams and engineering.<p>I hope this project doesn&#x27;t die out. A lot of people would pay for this.
评论 #21169772 未加载
pj_mukhover 5 years ago
This is pretty neat! As this is an offshoot of some autonomous car project, what would the support be for 3D data. If I wanted to see some LIDAR or Pointcloud data in browser? Esp if its a tf-output.
评论 #21170638 未加载
stekernover 5 years ago
This looks really promising! I recently wanted to make an interactive GUI to control the inputs to a GAN in order to generate images and visualize how different inputs affect certain properties of the output images.<p>I ended up converting my Python models to TensorFlow.js and creating an ad-hoc Vue.js app [0], but Streamlit could have been very beneficial here, especially if you can just put nginx in front of it and serve it to the masses.<p>[0] <a href="https:&#x2F;&#x2F;thispicturedoesnotexist.com" rel="nofollow">https:&#x2F;&#x2F;thispicturedoesnotexist.com</a>
mxwsnover 5 years ago
Does anyone have any hands-on experience with this? It looks impressive. I&#x27;m interested in contrasting this with dash plotly for python
评论 #21169477 未加载
asimjalisover 5 years ago
Can this be used from within the Jupyter notebook?
评论 #21169964 未加载
danielvfover 5 years ago
I use Jupyter notebooks all the time for acquiring, cleaning, and exploring datasets. Occasionally these notebooks mutated into tools for more than just one off exploring. It&#x27;s always felt a little awkward to use them for more day to day data tasks. Steamlit looks amazing for these cases!
ariskkover 5 years ago
This is truly lovely. I went from ‘pip install’ to reproducing one of our internal dashboards in ~1 hour. One issue: Auth and ACLs seem to be part of the paid&#x2F;hosted version so it needs extra work to become viable for most people
ppodover 5 years ago
This looks excellent. I&#x27;m an avid RShiny user and can&#x27;t wait to try this and Dash. Is there an example for how to host (e.g. on aws or google cloud) and make an app available online?
评论 #21174397 未加载
评论 #21172084 未加载
j0e1over 5 years ago
This looks super interesting. I relate to the motivation of building something like this- the endless cycle of creating a Jupyter notebook which becomes a Flask app. I really liked the quick feedback loop for the visual components and the fact that it is all in Python.<p>I haven&#x27;t checked yet but a question that comes to mind is how extensible is this framework. I can easily see how I&#x27;d want to make custom widgets.
评论 #21169940 未加载
polm23over 5 years ago
This is cool but it&#x27;s already been on the top page twice this week...<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21127528" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21127528</a> <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21126477" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21126477</a>
评论 #21169661 未加载
pythonwutangover 5 years ago
Looks great! Thanks for the hard work Streamlit team. Our team started using Dash recently for an ML project and quickly got lost in callback hell and switched back to a notebook. This approach is so pythonic and elegant. Looks like it would handle our use case with much less code and callback related head aches. I’m excited to share it with our team!
fleur-de-lotusover 5 years ago
The demo is broken on Macos: &quot;Streamlit failed to hash an object of type &lt;class &#x27;code&#x27;&gt;.,<p>More information: to prevent unexpected behavior, Streamlit tries to detect mutations in cached objects so it can alert the user if needed. However, something went wrong while performing this check.<p>Please file a bug... &quot;
boboshaover 5 years ago
can this be used for building web apps at production scale?
评论 #21169983 未加载
评论 #21169462 未加载
westurnerover 5 years ago
Cool!<p>requests_cache caches HTML requests into one SQLite database. [1] pandas-datareader can cache external data requests with requests-cache. [2]<p>dask.cache can do opportunistic caching (of 2GB of data). [3]<p>How does streamlit compare to jupyter voila dashboards (with widgets and callbacks)? They just launched a new separate github org for the project. [4] There&#x27;s a gallery of voila dashboard examples. [5]<p>&gt; <i>Voila serves live Jupyter notebooks including Jupyter interactive widgets.</i><p>&gt; <i>Unlike the usual HTML-converted notebooks, each user connecting to the Voila tornado application gets a dedicated Jupyter kernel which can execute the callbacks to changes in Jupyter interactive widgets.</i><p>&gt; <i>- By default, voila disallows execute requests from the front-end, preventing execution of arbitrary code.</i><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;reclosedev&#x2F;requests-cache" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;reclosedev&#x2F;requests-cache</a><p>[2] <a href="https:&#x2F;&#x2F;pandas-datareader.readthedocs.io&#x2F;en&#x2F;latest&#x2F;cache.html" rel="nofollow">https:&#x2F;&#x2F;pandas-datareader.readthedocs.io&#x2F;en&#x2F;latest&#x2F;cache.htm...</a><p>[3] <a href="https:&#x2F;&#x2F;docs.dask.org&#x2F;en&#x2F;latest&#x2F;caching.html" rel="nofollow">https:&#x2F;&#x2F;docs.dask.org&#x2F;en&#x2F;latest&#x2F;caching.html</a><p>[4] <a href="https:&#x2F;&#x2F;github.com&#x2F;voila-dashboards&#x2F;voila" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;voila-dashboards&#x2F;voila</a><p>[5] <a href="https:&#x2F;&#x2F;blog.jupyter.org&#x2F;a-gallery-of-voil%C3%A0-examples-a2ce7ef99130" rel="nofollow">https:&#x2F;&#x2F;blog.jupyter.org&#x2F;a-gallery-of-voil%C3%A0-examples-a2...</a><p>Acess control and resource exhaustion are challenges with building any {Flask, framework_x,} app [from Jupyter notebooks]. First it&#x27;s &quot;HTTP Digest authentication should be enough for now&quot;; then it&#x27;s &quot;let&#x27;s use SSO and LDAP&quot; (and review every release); then it&#x27;s &quot;why is it so sloww?&quot;. JupyterHub has authentication backends, spawners, and per-user-container&#x2F;vm resource limits.<p>&gt; <i>Each user on your JupyterHub gets a slice of memory and CPU to use. There are two ways to specify how much users get to use: resource guarantees and resource limits.</i> [6]<p>[6] <a href="https:&#x2F;&#x2F;zero-to-jupyterhub.readthedocs.io&#x2F;en&#x2F;latest&#x2F;user-resources.html" rel="nofollow">https:&#x2F;&#x2F;zero-to-jupyterhub.readthedocs.io&#x2F;en&#x2F;latest&#x2F;user-res...</a><p>Some notes re: voila and JupyterHub:<p>&gt; <i>The reason for having a single instance running voila only is to allow non JupyterHub users to have access to the dashboards. So without going through the Hub auth flow.</i><p>&gt; <i>What are the requirements in your case? Voila can be installed in the single user Docker image, so that each user can also use it on their own server (as a server extension for example).</i> [7]<p>[7] <a href="https:&#x2F;&#x2F;github.com&#x2F;voila-dashboards&#x2F;voila&#x2F;issues&#x2F;112" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;voila-dashboards&#x2F;voila&#x2F;issues&#x2F;112</a>
floki999over 5 years ago
This looks very interesting and addresses a very common use-case - thanks for showing.
LukeB42over 5 years ago
This looks excellent. Thank you.<p>Can we use asyncio to update multiple charts simultaneously &#x2F; at arbitrary intervals?<p>Wouldn&#x27;t it be better if Jupyter absorbed this API for its dashboards?
sriram_malharover 5 years ago
Beautiful, beautiful. I look forward to playing with it.
rosstexover 5 years ago
Python is fun again!
neximo64over 5 years ago
Does anyone else get a 404 on running streamlit hello?
评论 #21178553 未加载
uptownfunkover 5 years ago
Wow it’s great to see the Pythonians finally realizing they need a Rshiny for python.. &#x2F;s
评论 #21171546 未加载
x775over 5 years ago
This is super awesome!
stOneskullover 5 years ago
this is great. thank you very much.
villgaxover 5 years ago
Dash anyone?