Latest / Talk Python To Me / #260: From basic script to interactive data sci app with Streamlit
Transcript
- 0:00If you work on the data science or data visualization side of Python, you may have come to it from a
- 0:05scripting side of things, writing just a little Python using its magical libraries with little
- 0:11structure or formalism to build a powerful analysis tool that runs in the terminal or
- 0:16maybe even in a Jupyter notebook. What if you could take that same code, sprinkle in a bit of
- 0:22a simple API and turn it into a fast and dynamic single page web application that allows your users
- 0:28to dive into the visualizations right there in the app? Well, that's basically what the folks over at
- 0:34Streamlit created, and we're going to dive into it with one of the creators, Adrian Truel.
- 0:38This is Talk Python To Me, episode 260, recorded April 9th, 2020.
- 0:56Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem,
- 1:02and the personalities. This is your host, Michael Kennedy. Follow me on Twitter where I'm at,
- 1:06mkennedy. Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on
- 1:12Twitter via at Talk Python. This episode is sponsored by Linode and Reuven Lerner's Ace Python interviews
- 1:19course. Please check out what they're both offering during their segments. It really helps support the
- 1:23show. Adrian, welcome to Talk Python To Me. Hey, Mike. So excited to be here. Thanks a lot for
- 1:29inviting me on the show. Hey, it's super happy to have you here on the show. A ton of people reached
- 1:33out to me when Streamlit was initially launched saying, there's this new thing. It has changed my
- 1:39world. You have to talk to the people behind it. And so now I'm excited to talk to the people behind it.
- 1:45Yeah, totally. It's awesome to hear that. And, you know, definitely for someone who's spent a lot of
- 1:52time, you know, in a room programming alone, it's really cool to have made something and hear people
- 1:58say, this is awesome. This, this, you know, really changed my life and my work. So that's great to hear.
- 2:03Yeah, it's a super cool product. And I think it's going to be fun to talk about. It really enables
- 2:09data scientists to get certain types of computation out there in a way that people can interact with.
- 2:16So I'm very excited to talk about it, where it came from, some of the technology inside of it and
- 2:21whatnot. But let's get started with your story. How'd you get into programming in Python?
- 2:25My story is that it's never too late to become a programmer. I actually went to college to study
- 2:31international relations. I was, came from a bilingual family and I, you know, I figured out I should do
- 2:36politics or something like that. Right. Leverage your bilingualism, right? What languages did you,
- 2:41do you speak? Well, okay. So my dad's French. So I grew up speaking French and English and we were,
- 2:47and then, you know, being, you know, growing up in the U S I'm surprising that I took Spanish.
- 2:51And then actually when I got to college, I took Chinese. So, you know, I didn't come from a family
- 2:59that really respected like programming and that kind of thing. And so it wasn't part of my world. And I
- 3:04feel kind of envious of kids who grew up, you know, went to science high schools and stuff,
- 3:08because in retrospect, that's really who I was. But it wasn't until I got to college and about a
- 3:14year and a half into studying international relations, I was like, this is not for me.
- 3:18Actually, I always thought college might not be for me. And then this professor of economics remembered
- 3:25me because I had blue hair. And he was like, you know, he said, Adrian, how are you doing? And I said,
- 3:30well, you know, not so well, I'm not even sure if I should be here. And he said,
- 3:35what you need to do is, he said, you're misallocated, which is a very economic way.
- 3:39That's a very economic way to describe your situation.
- 3:42Yeah, exactly. And so he was like, what you need to do is you need to study math and science. And I was,
- 3:48you know, anyway, I thought that that was ridiculous, literally, but I took him up on his offer.
- 3:54And it calc one, my sophomore year of college took intro to programming, was like blown away. It was
- 4:01like, these are my people, this is my work. And I'm just so grateful. I found it. Oh, my God. I mean,
- 4:07wow, what a fun job to have. And what a fun world to be in. And also, this is back in the late 90s.
- 4:13It wasn't 100% as obvious as it is today that this is like, generally, generationally changing for all
- 4:20of culture. And obviously, it is everyone sees that now. And so I feel really lucky to have gotten in.
- 4:24Yeah, how lucky that you had that interaction. And you found your place because I think a lot of people,
- 4:30they don't find their place in the world, they find a place that they're comfortable with,
- 4:34and they end up in a place that's okay.
- 4:36Absolutely.
- 4:37They don't wake up going, wow, I get to do this.
- 4:41Yeah. And I really think, you know, being able to figuring out taking time to figure out like,
- 4:48what you really would enjoy doing and trying a lot of different things. I just can't think of
- 4:54anything more valuable. I really actually think the whole world is a little bit misallocated
- 4:59to a certain extent. And if everyone can sort of play musical chairs and, you know, get the right job,
- 5:04for a better job, we can just unleash like massive new economic potential. So,
- 5:09you know, that's true for my life. It's also been part of actually a theme of my professional life as
- 5:14well. So I can talk about that. But anyway, yeah, figuring out what you love to do is I think so
- 5:20valuable. And I'm so grateful for that professor.
- 5:23That's amazing. I do think there's a little bit, I don't know how to solve this. But I do think there's
- 5:28a little bit of a mismatch, where people tell you, you have to find something that you're passionate
- 5:33about, or you're not going to be happy in your career. I think that you find something that connects
- 5:40with you. And you didn't even know that it was going to connect with you. And then you polish that
- 5:45skill. And then you become very passionate and excited about it. So when you, I think when young
- 5:51people hear advice, like you have to do what you're passionate about, like when you're young, and you
- 5:54haven't had that exposure, like imagine you hadn't taken that math class, like, you weren't passionate
- 5:59about math. It's not like you're like, well, get out of my way, you know, languages, I'm going to math,
- 6:04right? There's a sort of chicken and egg thing. And I think it's really hard to unlock that potential
- 6:09for a lot of people in general. I don't know. I don't know what to give people advice about that.
- 6:14But it's it's I think it's interesting that it's important to do what you're passionate about. But like,
- 6:19you got to somehow explore to get that figured out.
- 6:22I agree. And I also think there may be different, there are different kinds of people, of course. And
- 6:28I don't think necessarily being passionate about what you do is as important to other people as it
- 6:33turns out it is to me. I don't want to over extrapolate either. But I do feel really grateful
- 6:39for, you know, have been given that advice. And it's actually come up in a couple other ways in my life.
- 6:45I created a game called Foldit that allowed hundreds of thousands of people to solve protein
- 6:51folding problems when I was doing my PhD. I think I've heard of that. Yeah, I'm pretty sure I did hear
- 6:56that. Yeah. So it was the gamification of trying to solve a protein folding problem. It wasn't like
- 7:03SETI at home where it was like just grid computing, right? It was leveraging human creativity, not
- 7:08distributed computing, right? Exactly. And that had sort of that theme. One of the coolest things about
- 7:14that project was that a lot of people found out, hey, this is something that I love doing. And they
- 7:19were able to contribute to society in like a new way that they've never experienced before. And so I
- 7:25think for a lot of people, it sort of unlocked a little bit this, you know, new skill. Yeah.
- 7:30And then coming to Streamlit, you know, what we are doing is building software that lets data
- 7:38scientists and machine learning engineers, like productize their work without the need of anyone else to
- 7:43help them so they can build apps that others can use. And again, I feel like for our users,
- 7:49we're giving them like a new form of impact in the world and in their companies. And I think that's
- 7:56where the passion comes from. So in a funny way, it does seem like a theme, both in my life personally,
- 8:02and also in the products that I've been creating.
- 8:05Yeah, absolutely. And so you went from not sure you should be at college to studying some math to
- 8:09being a professor at Carnegie Mellon. That's a big, big U-turn.
- 8:13Yeah, yeah, yeah, yeah, yeah. But you know, actually, in a funny way, the I don't think the
- 8:18quest ended there. Because when I was a professor at Carnegie Mellon, there were some things that I
- 8:22really loved about it. But I felt that I wasn't directly affecting the world the way I do now at
- 8:30Streamlit. So and in a sense, we were doing super fascinating, very mathematical, big data stuff.
- 8:38And it was from an intellectual standpoint, I mean, heaven to the power of heaven.
- 8:43But I was missing that that other aspect of things, which is really, you know, having an audience beyond
- 8:52a couple hundred experts in the world in some way. Both are totally valid and extremely important
- 8:58forms of impact each in their own way. So I am a huge believer in academia, and it's important in
- 9:04society. I personally wanted a little bit more direct connection to the, you know, the quote,
- 9:10unquote, the user. And that has taken me through a variety of different jobs at Google X, working on
- 9:19self-driving cars at Zoox, and then finally starting Streamlit. And for the first time since I created
- 9:26Foldit, I'm hearing people say, wow, this is really changing my life. And that's so exciting to have
- 9:32created a product that has that property. It's amazing you've done it twice, right?
- 9:35And with this, you've made something that's made a big impact for a lot of people.
- 9:40It is really gratifying. And I think, you know, the gratifying part is to, first of all, it gets to,
- 9:46you know, build cool things and work on cool ideas, but also just have other people feel like their jobs
- 9:53are more interesting and more fun, and they're having more impact because of some piece of technology that
- 9:58we've pulled out. And so I think that's just great. I think that's just so exciting.
- 10:03I agree. So today, day to day, you're working at Streamlit with Thiago and Amanda, your co-founders,
- 10:10and I'm guessing some other folks on the team. What kind of work are you doing there?
- 10:13Okay, so we're about nine people, and we're about 18, including contractors, and we are hiring a lot
- 10:20all across the United States. And we are basically building two products, one of which is Streamlit,
- 10:28and the other of which is Streamlit for Teams, which allows people to build data apps really
- 10:36quickly in Python. Streamlit for Teams allows them to deploy it really easily, and so that others can
- 10:41use it. And then my day is pretty much, well, my dream day is pretty much I'm chatting with the
- 10:50engineers and working on design docs and thinking about cool problems. Somehow that's like very rarely
- 10:56my actual day. I don't know how it happens, but my actual day is often just like meetings,
- 11:01meetings, meetings, meetings, meetings, talking with investors. I don't know, thinking about
- 11:05payroll stuff and not sure how, despite my effort over years to make that not be the case, that is
- 11:13still the case, but that is still the case.
- 11:16Here you find yourself, but you know, that's kind of what it takes to get some of the stuff going,
- 11:21right? So yeah, totally, totally. Yeah. And I think, you know, ultimately what has made Streamlit
- 11:29great has not actually been my ideas per se, but really actually the ideas of the community
- 11:37and also of the engineers working on it. And so I try to remember that even though I have a dream job
- 11:44of working on every aspect of the product, probably for everyone else's benefit, I should just get out of
- 11:49the way and let them do the magic. Yeah. That sometimes is how it is, right? It's just let
- 11:53let the people do the work, even though it would be very fun. Now I want to get into some of the
- 12:00origins and whatnot, but I also just want to set the stage as people are listening, because this was
- 12:04something I was not entirely clear about as well. Yeah. So you spoke about Streamlit, the tool for
- 12:11building interactive UIs around data science, and you spoke about Streamlit for teams, talked about hiring
- 12:16people. So obviously this is a business venture. Yeah. The status, which is great. I'm super supportive
- 12:22of you guys. That's awesome. But I just want people to realize that Streamlit, the tooling in the library
- 12:28is an open source thing that you can use. And the teams thing is like a cloud computing service that is
- 12:35part of the business. Is that, am I understanding that right? Yeah, that's exactly right. And speaking of
- 12:39the origin story, it wasn't actually meant to be a business. It was really a side project and it was
- 12:46going to just be an open source project. But what happened was a bunch of people at really big companies
- 12:54like Stitch Fix started using it. And then we realized, hey, there is actually a business model
- 13:00here. And so the picture started, in a sense, it all kind of snowballed from what was really first,
- 13:05just a personal project, me at home, coding all day long. And my mom saying, hey, you need to figure out a way
- 13:12to make money off this thing. You're going to work on it so much. And then it sort of has evolved into a business.
- 13:17And so, yeah, there's actually a very simple breakdown in terms of the open source and the business part,
- 13:25which is open source is lets you build data apps super quickly and easily. It's free, always will be free.
- 13:33Apache 2 license. It's a real open source project. Everything's up on GitHub. The community contributes a lot.
- 13:38We build it a lot and maintain it. So that's the open source part of the project.
- 13:42The closed source part of the project lets you take your streamlit apps and deploy them really easily on our cloud.
- 13:50You're certainly welcome to just deploy it for free, however you'd want. And there's tons of guides online about how to do that.
- 13:56And we totally support that aspect of the community. So there will always be a way to create and deploy streamlit apps
- 14:02for free using only open source tools. But we also recognize that a lot of our users and especially corporate users
- 14:09are asking for a simpler solution to that side of things, the deployment, not the app building.
- 14:14Well, I think it makes a lot of sense because the goal of the tool is to make converting like data science ideas and libraries
- 14:23and problem solving into an interactive web app really easy. And so the last thing you probably want to do is like,
- 14:30well, that was cool. Now you need to figure out Nginx. You need to figure out SSL. You need to figure out cache.
- 14:35You need to figure out Linux maintenance, et cetera, et cetera.
- 14:37Exactly.
- 14:38I think it's a reasonable thing to do for sure.
- 14:40Yeah. I think that the experience that our users have is they download Streamlit. So pip install Streamlit,
- 14:48follow the tutorial, literally within 30 seconds, they have an app that they're playing around with. Within
- 14:55five minutes, they've created their own and there's a little button or something. And I think that what we
- 15:01hope for is delight. But then it comes to, I want to share this with others.
- 15:07And you go into the, you search around on Google and it's literally starts to become,
- 15:12you know, create a GCP instance, copy your SSH keys into it. I'll tell you, that's a nerve wracking
- 15:21experience to actually try to put something on the web and have it secure and everything. So we want
- 15:27to bring that delight to the deploy as well. And that's kind of the picture.
- 15:33This portion of Talk Python To Me is brought to you by Linode. Whether you're working on a personal
- 15:37project or managing your enterprise's infrastructure, Linode has the pricing, support, and scale that you
- 15:42need to take your project to the next level. With 11 data centers worldwide, including their newest
- 15:47data center in Sydney, Australia, enterprise grade hardware, S3 compatible storage, and the next
- 15:54generation network, Linode delivers the performance that you expect at a price that you don't.
- 15:59Get started on Linode today with a $20 credit and you get access to native SSD storage, a 40 gigabit
- 16:05network, industry leading processors, their revamped cloud manager at cloud.linode.com,
- 16:11root access to your server, along with their newest API and a Python CLI. Just visit talkpython.fm
- 16:17slash Linode when creating a new Linode account, and you'll automatically get $20 credit for your next
- 16:23project. Oh, and one last thing, they're hiring. Go to linode.com slash careers to find out more.
- 16:28Let them know that we sent you.
- 16:30I haven't interacted with the deployment side of things, but I can tell you that the web app side,
- 16:36it's got a little bit of magic. So let's get into that, but let's start at maybe the predecessor,
- 16:43right? A lot of people are coming into Python these days. This is my assessment of looking out at the
- 16:50world. They're coming into Python for a little bit of computational scripting. I hate to call it
- 16:57scripting because when people say, Oh, Python's a scripting language. It's like,
- 17:00yeah, but you also, it's a programming language that supports scripting, right? Like it's,
- 17:04there are a lot of people who they don't care about computer science. They definitely don't think of
- 17:12themselves as programmers. They think of themselves as economists, biologists, whatever. But they're like,
- 17:20I know I got it. This data is too much for me to do on my own. I Excel or whatever. So I'm going to
- 17:24throw it into this. I've learned that if I use Jupyter, I type these five lines using this library,
- 17:29no functions in sight, you know, no unit tests, none of that. Just like I do these,
- 17:34these five or 10 lines in order. Then I have this really cool power. And then they get sucked into
- 17:40Python, right? Like, yeah, they could do a little more and a little more. And like, eventually they look
- 17:44back and like, wait, I'm programming. How did I become a programmer? Which is great. But I think
- 17:49like where you guys are aiming is that audience a little bit, right? The people who are like,
- 17:57I can put this together in kind of a top to bottom flow of computation and generate results,
- 18:02but I need more than that, but I'm not a programmer. Would you say that's fair?
- 18:06Yeah, that's exactly right. So we really embrace Python as a scripting language. That's the core of
- 18:15Streamlit. And we embrace the ethos of let's write code from top to bottom that does something simple,
- 18:24that's easy to understand and read. And that really gives you a huge amount of power for,
- 18:32you know, a huge amount of bang for your buck. I mean, that's what Python is, right? You know,
- 18:36how do I, how do I download some information off the web requests package, boom, boom, boom,
- 18:42all of a sudden it's happening. And I think actually Python programmers, myself very much included,
- 18:48are like shocked when you go to another programming language and you're like, oh, I, yeah, totally.
- 18:52You know, we just, you do, you know, do all these things. And then you're like, oh my God,
- 18:57this is impossibly difficult. How are these people doing this? You know? So there is still,
- 19:04I mean, it's an old, it's getting to be an old language and yet there's this magic to it. And
- 19:07there's this bang for the buck that it's just unparalleled. And, and Streamlit is grounded in
- 19:13that observation and in that ethos, which is let's write script and let's extend Python in a new
- 19:21direction, which is really being able to write web apps, especially data web apps that capture something
- 19:27about what you've done as a data scientist or a machine learning engineer and allows lots of people to play with it
- 19:33use it and understand it and actually become part of business processes. And,
- 19:37yeah.
- 19:37And we've seen, you know, become part of the fabric of your company or of your group or of the world.
- 19:43People are creating lots of COVID apps, for example, both to teach other people about coronavirus,
- 19:49but also in some cases, the University of Penn hospitals released a Streamlit app to allow
- 19:55other hospitals to predict how many beds they need.
- 19:57Yeah. That's very useful, right? That's taking the models and applying them for,
- 20:01you're going to need to get five more or something like that. Right. Very concrete.
- 20:05Exactly. Exactly. Very concrete. And very much sort of the next step in data science beyond just,
- 20:12you know, I've created a graph once for, to paste into a, you know, spreadsheet or into a presentation.
- 20:18It's like, well, what happens when I need to do this repeatedly and when a lot of people need to interact with it and play with it?
- 20:24I use it, I should say. And then, and then how can we do that without embracing this scripting ethos?
- 20:31We want to make app creation as easy as writing scripts in Python. And that's really the core sort of philosophy that motivates Streamlit.
- 20:38And I think the capturing that magic is what has caused so many people to get excited by it.
- 20:45Yeah, I think you're right. And I think it's an interesting blend between notebooks and more proper programming, but just a little bit.
- 20:54So we'll talk about some of the examples and whatnot you have that are really cool, but they are Python files and they do have functions in them,
- 21:03but they're not, not like super advanced. Right. So it feels like they're almost kind of organized,
- 21:08like someone might organize a notebook for scripting, but it's a little bit more formal than a tiny bit more formal than that.
- 21:15But what you gain on the other side is like tons of interactivity, which is pretty cool.
- 21:19So when you look at the Streamlit, you guys talk about it, you say, basically the goal is to bring three things together.
- 21:26The Python scripting, which we talked about. The next one is interaction to basically make this an interactive thing for users,
- 21:34more or less the productization of that stuff. Right. So users can play with it, not just developers.
- 21:40And the final bit is deployment that we've kind of touched on, but we haven't talked very much about the interactive bit,
- 21:46which I think is also some of the magic because honestly, I look at this and I don't necessarily fully understand it
- 21:52because I've written a lot of GUI applications. I've written 3D simulators and whatnot.
- 21:58And I, you know, I wasn't super great at it, but I know what the code looks like.
- 22:03I've done tons of GUI apps with, with callbacks and whatnot.
- 22:07Yeah.
- 22:08You seem to have been able to achieve those types of things without loops and without explicit,
- 22:17how this button event wires up to this callback and all that async kind of stuff that's so common around UI.
- 22:24So maybe we should talk about the interaction bit.
- 22:26That's exactly right. The ethos of scripting is basically, I'm going to write a script that,
- 22:32you know, loads some data, transforms it, does some other stuff, and then it's done.
- 22:37The ethos of app development is totally different. It's, I'm going to declare a bunch of widgets on the screen.
- 22:45I'm going to wire them up with callbacks. I'm going to have state that changes over time.
- 22:49I'm going to be interacting with the web and have premises and stuff.
- 22:54It is a truly different form of programming fundamentally and typically requires a lot of time to do even fairly small things.
- 23:06I mean, that's, you know, it's not easy to build an app actually.
- 23:09At a minimum, it takes a different way of thinking about programming that is not just like these 10 lines, right?
- 23:14That's exactly right. It's a different way of thinking about programming.
- 23:17And we really tried to ask ourselves, how could we make writing an app as simple as writing a script?
- 23:28And so we give the Streamlit programmer a very, very simple to understand paradigm,
- 23:37which is basically like sort of a cross between just a fancy print statement.
- 23:44So, you know, in Python, you can always just say print, blah, blah, blah.
- 23:47And then that gives you an ability to see what's going on and understand.
- 23:51Right. If you want to level it up, you put some colorama in there and like make it.
- 23:55Yeah, exactly. Yeah, exactly. Or, you know, if you're in Jupyter, you can say, like, let's look at the graph or, you know,
- 24:02you can start doing some visual output.
- 24:04So we basically give you that as a basic primitive.
- 24:07It's called S-T Streamlit dot write, R-I-T-E.
- 24:12And then you can just plop anything you want in there and it pops up on your web browser in order.
- 24:16And then we say, hey, and if you want any interaction at any point, you can just say S-T dot and then just give it.
- 24:24We've got a whole bunch of widgets, you know, sliders, text boxes and whatnot.
- 24:28And that pops up on the screen.
- 24:30And then we wire it all together so that if the user types or changes anything on the web browser,
- 24:38that gets reflected back in your code instantly without having to do any work.
- 24:42And so the model is just so simple to understand and therefore so productive.
- 24:49And we want to bring that Python simplicity and that Python magic to the app building process
- 24:56and make it so that others can just build apps really easily.
- 24:59Probably the best way to give people a sense of this is maybe to walk through an example.
- 25:04You guys have a couple of example bits of code out there.
- 25:08And right at the beginning, you go to the Streamlit website, Streamlit dot IO.
- 25:13You can go down a little bit.
- 25:14There's like a get started, just pip install Streamlit and a few other things.
- 25:19And then there's an example that you can just run that comes with it.
- 25:24And this has to do with stealth driving cars, which you and your co-founders have a lot of background in self-driving cars.
- 25:30Yeah, yeah.
- 25:31Which is kind of cool, right?
- 25:32Totally.
- 25:32So the idea is there's a lot of image processing that goes on around identifying people, other cars, bikers,
- 25:40certain tolerances of whether or not that is a biker or not, and so on.
- 25:45And so you can basically get this demo and explore those.
- 25:50You say, I'd like to have up to five, but no more than six pedestrians on the screen.
- 25:55And then I want to test like parameters around it and stuff, right?
- 25:58Yeah, that's exactly right.
- 25:59So this is a problem that comes up in the self-driving car industry.
- 26:04Really, it comes up in all machine learning and all data science.
- 26:08In my experience, I've seen this again and again across groups at Google,
- 26:14self-driving cars, companies across the country, which are now using Streamlit and telling us what their challenges are.
- 26:20And so it's really a perfect example of a simple Streamlit app, which is I have a whole bunch of data, domain specific,
- 26:29and I need a way to be able to browse through it and understand what's going on.
- 26:34And I might need to look through it.
- 26:36I might need to maybe run some models on it and or blend a couple of different data sets together.
- 26:43And Streamlit makes those kinds of tasks really easy by just taking the basic elements of Python and adding a tiny little bit on top to make it a map.
- 26:53So in this case, the challenge was something that we saw when building self-driving cars is that you drive your cars all around the city and you're collecting like all this data.
- 27:03And at a certain point, even understanding all the data that you have becomes really complicated.
- 27:08And lots of people need to be able to see it, not just the engineers, but technical program managers and executives and everyone needs to be able to see what's going on.
- 27:15And so you eventually build an app to allow many different stakeholders to see and understand this data.
- 27:23And so we built this app to illustrate how that can be done in Streamlit.
- 27:27It uses the Udacity self-driving car data set as an underlying data set, lets you visualize where there are pedestrians and cars.
- 27:36It even lets you run a neural net in real time.
- 27:38And the entire app is built in 300 lines of Streamlit from top to bottom.
- 27:43There's also like 50 lines of comments.
- 27:45So I would say.
- 27:45Yeah, yeah, yeah.
- 27:47Yeah, it's 300 lines.
- 27:48And it's not even like we're not even trying to be super, you know, we're not playing like code golf or anything.
- 27:53Like the 300 lines includes like a huge like Apache 2 license and a lot of comments.
- 28:00And yeah.
- 28:01So in fact, I think there's only like 20 some odd function calls, Streamlit function calls in the entire program.
- 28:08So everything else, basically, this very, very rich app is created in.
- 28:1520 function calls and everything else or let's call it 25.
- 28:18Everything else is just pure data.
- 28:20So that's kind of a glimpse, hopefully for the listeners of just like this fact, which is that like you can just do a lot with a little, which is just a great thing to have.
- 28:32Yeah.
- 28:32So let me do two things.
- 28:33Let me describe a little bit of what this app looks like when it's running so people get a sense.
- 28:38So when you run the app, you get a web page that is running on its own little local Streamlit server.
- 28:44And on the left, you get a sidebar that lets you basically do the user interaction, right?
- 28:49Like I can say, what type of object am I looking for?
- 28:53And then how many of those objects and depending on what you get, you can have like different types of confidence and whatnot.
- 28:59So there's this sort of cool interactive slider thing on the left.
- 29:02And then on the right and the main pane, there's kind of output from that, like pictures with selected characters in the picture from the neural net or graphs or whatever.
- 29:11Right.
- 29:11That's exactly right.
- 29:13Yeah.
- 29:13And so, you know, it's all the basic elements of Streamlit are there.
- 29:17So you get some user input.
- 29:19Right.
- 29:19And so if I change like the dropdown or I change the slider as a user, talk about the user input, right?
- 29:25Then that automatically is reflected back in the changing views of the graphs or the detection of the picture.
- 29:32So that's a super cool type of dynamic interactive web app.
- 29:37It's not posting back the page.
- 29:39It's like a JavaScript spa type of application you would expect.
- 29:43That's exactly right.
- 29:44That's exactly right.
- 29:45Yeah.
- 29:45And, you know, it actually, this is just, this is trying to show what's possible in 300 lines of code with a 20 some odd Streamlit call.
- 29:53But some of our users, especially corporate users, build really intricate, not just single page applications, but, you know, multi page applications with different levels of authentication for different users.
- 30:07And, you know, interactions with databases and, you know, interactions with databases and they go both ways.
- 30:12So it's really the sky's the sky's the limit.
- 30:15It is actually possible to build, you know, production quality apps used by many people fully in Streamlit.
- 30:23And, you know, and in fact, to do so really as a data scientist or as a machine learning engineer without having to learn and then wield a pretty complicated and, you know, quote unquote pro tech stack.
- 30:38Like, you know, Flask and then CSS, JavaScript, HTML, React, whatever it is.
- 30:43That we love those tools.
- 30:45For that matter, we wrote Streamlit in those tools.
- 30:48So we really love them.
- 30:49But we recognize that for a lot of people, even if they do know them, it's a big lift to start building an app in that way.
- 30:57And it's really fun to not have to.
- 31:00And you can do a lot.
- 31:03Yeah, that's cool.
- 31:05The other thing that's interesting and that's where that's notable, I guess, is a lot of these types of tooling that try to make things more accessible or more productive.
- 31:17They say, OK, well, what you're going to do is you're going to work with our little widgets and our little libraries.
- 31:23And the reason it's simple, because you don't need to learn about databases.
- 31:26So you use our data library and it magically does data magic.
- 31:29Right.
- 31:30Right.
- 31:31Yeah.
- 31:31But right at the top you have of this example, you have import Altair, import Pandas, import NumPy, import OpenCV.
- 31:39Right.
- 31:39That's right.
- 31:40I guess what I'm pointing out is like these are the tools that data scientists are already using.
- 31:45They already know how to use and they're already like very effective and polished.
- 31:49So it's not like, well, you can give up your Altair or your Bokeh and your Pandas and you could use our style.
- 31:55Right.
- 31:56That doesn't seem to be the story you're telling.
- 31:58Yeah, that's right.
- 31:59I think that there is a really interesting balance between simplicity, power and accessibility in regards to using other existing open source frameworks.
- 32:14And one of the sort of strategies that some people have tried is we will be the platform.
- 32:21We will define everything and you will live in our walled garden.
- 32:25And that's how we'll make things quote unquote simple.
- 32:28That's not really the ethos of open source.
- 32:30Really, the ethos of open source is more like we're going to do one thing really, really well.
- 32:35We're going to be modest in a sense in what we provide, but we're going to provide a great version of it that then you can mix and match with other open source tools.
- 32:44And that's the ethos of Streamlit.
- 32:47We do one thing, which is let you build apps.
- 32:50We try to do it the best in the world, of course.
- 32:52And then we get out of the way and we say, use everything that you know about existing graphing tools, just Python, all of the, you know, Snowflake, Pandas, NumPy, Scikit, Learn.
- 33:04The entire Python ecosystem is just directly available to you.
- 33:08Yeah, that's really cool.
- 33:09It also means you're not like super tied to Streamlit if you decide actually no or whatever, right?
- 33:14Totally.
- 33:15Exactly.
- 33:15You could say we could do it in Notebook or we could try it in Streamlit and or not, right?
- 33:20Like it's, I really appreciate about that, about what you built.
- 33:23This portion of Talk Python To Me is sponsored by me, Reuben Lerner, and my free video course, Ace Python Interviews.
- 33:33You know, one of the most stressful parts of a job interview is when they ask you to explain a concept
- 33:37or to solve a problem with Python.
- 33:39Ace Python Interviews contains six hours of screencasts solving 50 beginner, intermediate, and advanced Python problems.
- 33:47You can even download the Jupyter Notebooks used in the screencasts.
- 33:50Give yourself an edge when you next apply for a job.
- 33:53Check out Ace Python Interviews for free at talkpython.fm/ace.
- 33:58I still don't fully understand how the magic works.
- 34:03So I want to talk people through it.
- 34:05And then maybe you can tell me like, oh, here's where the magic is.
- 34:09Yeah, for sure.
- 34:10All right.
- 34:10So let me talk through some of the code.
- 34:12I just pulled out a few little examples of things that are interesting as you go through
- 34:15that self-driving demo.
- 34:16So let me run past you.
- 34:18Yeah.
- 34:19So first of all, like I already talked about this.
- 34:21You have functions.
- 34:23You've got a main function at the top.
- 34:25And then you've got other functions like download the files, like go and get those self-driving car model
- 34:30datas and the images and whatnot.
- 34:33And you've got other functions for like showing what are some of them or like running one to like run the app,
- 34:42one to select different parts of the UI, one.
- 34:45Yeah.
- 34:46And whatnot.
- 34:47So you have this broken down like a well-structured script, I guess you would say.
- 34:53Like it's all self-contained in this file.
- 34:54It's not like a notebook exactly.
- 34:56But it is broken to function.
- 34:58So I appreciate that.
- 34:59I also like the fact that you put the main method at the top and then it functions below.
- 35:04I always see that in mind because here's the summary of what's happening.
- 35:07Here's the details, right?
- 35:08It always seems to be reversed a lot of times.
- 35:09That drives me crazy.
- 35:10Yeah.
- 35:11But so first thing is like you want to have some message on the screen that is the UI of the web app.
- 35:17And the way you do that is load a markdown file and parse it and render it using like one line,
- 35:23like st.markdown.
- 35:26Boom.
- 35:26Give it a file name.
- 35:27And then that's part like a portion of the UI is that, right?
- 35:30Yeah, that's right.
- 35:31There's a couple of cool things to note about that.
- 35:33First of all, we do let you write well-structured code, quote unquote, well-structured code if you want.
- 35:39Using names, functions and stuff is great.
- 35:42You also don't have to.
- 35:44It literally is just a Python script.
- 35:46So you could get rid of all these function calls and just write it as a script from top to bottom.
- 35:50And that works too.
- 35:50And you get all the interaction and everything.
- 35:53But we think it's cool that you get to write some function calls and structure your code that way.
- 35:57And if nothing else, it actually mostly just helps describe what's going on to the user.
- 36:03Which is one of the great properties of functions.
- 36:06Then the other thing that you pointed out, which is true too, is that we've did in one line of code,
- 36:11we've put a giant markdown file right on your browser.
- 36:14And that's the instructions for how to use the app.
- 36:16And that's pretty cool.
- 36:18Yeah.
- 36:18It's pretty simple.
- 36:19And it does exactly what you expect.
- 36:21And then later on, we say, hey, if you, a couple lines down, we say, once they select which mode they want, we just get rid of that, those instructions.
- 36:29And that's pretty simple also.
- 36:31So it's a pretty cool little, yeah, it's a pretty simple little way to do things.
- 36:35Yeah.
- 36:36So that doesn't take over the whole screen.
- 36:38That kind of just goes up there as like part of the UI.
- 36:40And then you say, probably when you run it first, you don't have these files.
- 36:43And they're like 400 megs, which is not a ton to download.
- 36:46But they're not on a super fast server.
- 36:49So they do take a little while to get down, actually.
- 36:51Yeah, yeah.
- 36:52And so what's really cool is you, you're just using requests and standard file IO to read and write them.
- 36:58But as you're looping through that, reading off the stream, you have two simple lines.
- 37:04You have a progress bar.
- 37:05Yeah.
- 37:06And you have like a text box area.
- 37:09And you say progress bar dot progress.
- 37:12And you give it like how far it is in the download.
- 37:14And then you say the weights area.
- 37:16You can say we're downloading this amount, you know, like five of 10, five of 400 megs.
- 37:21Or whatever.
- 37:21Yeah, yeah, yeah.
- 37:225.1, 5.2.
- 37:23And as you're looping, you're changing those values.
- 37:27And that is just dynamically changing the web app.
- 37:29Yeah, yeah, yeah.
- 37:31That's part of the magic right there for me, I think.
- 37:33Oh, my God.
- 37:34I'm so excited that you've been reading the code at this level.
- 37:38I mean, what delight to talk about this.
- 37:40Yeah.
- 37:41So that's the next bit of magic, which is you can think of it as like a sort of, you know, magical print statement.
- 37:47Yeah.
- 37:47Instead of saying print blah, you say st dot write blah.
- 37:51And then you can just pop things on the web browser screen from top to bottom.
- 37:54Markdown, data frames, graphs, anything you want.
- 37:57But the next bit of magic is that those things that you put on the screen are not just stuck there.
- 38:03You can reach out to any one of them and say, hey, I want to change you.
- 38:07And for example, I want to take this progress bar and move it from 51% to 52%.
- 38:12Or I want to take this text and I want to change it from foo to bar.
- 38:16That ability to reach into the web page that you just created in pure Python and just update things is animation.
- 38:23And then you throw that into a loop and all of a sudden you have progress bars going from left to right and download information.
- 38:31And it's really no more complicated than just writing a script.
- 38:37Yeah.
- 38:37And it looks to me like the visual layout story here is like kind of a column layout on the main screen.
- 38:46So I just throw stuff into the UI.
- 38:48Like I say, I want to dial, I want a text area.
- 38:52So I just create a like a warning text area or whatever.
- 38:54And I create a progress bar.
- 38:56I just say I'm creating one and it just, it piles, it sort of visually piles up like one after another vertically.
- 39:02Right.
- 39:02So you don't, there's not a lot of position this at X, Y here, or like set this to like dock this style.
- 39:09It's kind of, you put them, there doesn't feel like I'm doing UI.
- 39:12It kind of just figures it out.
- 39:14I guess what I'm talking about.
- 39:15Yeah, exactly.
- 39:16The paradigm is just like a print statement.
- 39:18It's just from top to bottom.
- 39:20And this is a, you know, I think that's the right default behavior.
- 39:24It's worth pointing out that the community has been saying for months, we want horizontal layout.
- 39:32We want more control.
- 39:33Yeah, yeah, no.
- 39:34I just want to put something to the right or something else, not just below it.
- 39:37And I want to say to all you programmers out there, we totally hear you.
- 39:44We are super excited about horizontal layout.
- 39:47It's coming.
- 39:48It's in the lab.
- 39:49We're working on some other really cool stuff like custom components
- 39:54that lets you insert your own custom widgets into the, into the streamlet page.
- 39:58Those are coming first.
- 39:59We're still a small team.
- 40:01We're also really trying to hire as fast as possible, but, but, you know, great programmers.
- 40:07So all of these, we feel a lot of pressure to get things out and we really hear you and we're getting it out.
- 40:13Please give us some time.
- 40:14And if you're, if you feel like you're the right person for the job, come join us and we'll work with you too that way.
- 40:20Yeah.
- 40:20Very cool.
- 40:20It's awesome that you're hiring.
- 40:21One other thing.
- 40:23So I guess that I can see how that works.
- 40:24So I have a progress bar.
- 40:25I call progress.
- 40:26It kicks off some asynchronous JavaScript event.
- 40:31That's going to go over and tell that progress bar to update.
- 40:34But the other part that this is where I was thinking more of the magic is like, if I want, say a slider that people can interact with, I can go over there and I can say, go and put a slider on the sidebar and then just ask some questions about it.
- 40:49And I don't see anywhere, some kind of callback for when the slider changes.
- 40:54I'm just getting that information.
- 40:55Yeah.
- 40:56And yeah, it's really interesting how the user interaction kind of comes back into the script.
- 41:02Yeah.
- 41:03Maybe tell me how that kind of works because I don't totally see like where the user interaction response starts versus like setting up things and so on.
- 41:12Yeah.
- 41:12First of all, I'll point out that this was just a suggestion by a user.
- 41:15And so this is an example of our user community really just having being the source of the best ideas in Streamlit.
- 41:22And he said, hey, you just you should have a checkbox that should just be like, you know, the answer equals checkbox.
- 41:31And that's how it should work.
- 41:32That's blocking.
- 41:35What am I going to do?
- 41:36Like, that's impossible.
- 41:37There's no way to do that.
- 41:38But we then went back to the, you know, the whiteboard, basically, and we asked ourselves, how can we do just that?
- 41:44And so the way it works is that if you ever want to have an interactive element in your app, you basically just say the answer equals and then the widget type.
- 41:57So the widget type could be a checkbox and then the answer will be true or false.
- 42:00It could be a text input and then the answer will be a string.
- 42:03It could be a number input or a slider and you'll get numbers and so on and so forth.
- 42:07You can even have file inputs.
- 42:09You can get, we're working on a color clicker.
- 42:11So there's a lot of cool stuff you can do.
- 42:12Okay.
- 42:13But this really simple model, no callbacks, just it's like at this moment, I want to materialize this variable and I want to let the user select it.
- 42:22It's similar to like, if you had done like print, which of these three options do you want?
- 42:27Input, parse it as an integer, right?
- 42:29Like it's the blocking, it looks like blocking calls.
- 42:31It looks like a blocking call.
- 42:32Yeah.
- 42:32And in fact, the goal is that you could just, is that you can just say, you know, this is a very typical thing when you're scripting is you say like, you know, number of iterations equals 50.
- 42:42And then you just keep coding, coding, coding, coding, coding.
- 42:44And then you say to yourself, you know, hey, it would be really nice if someone could select the number of iterations.
- 42:48I don't have to keep editing this text file.
- 42:50So then you just go to that one line of code and you say number of iterations equals st.number input.
- 42:55Default equals 50.
- 42:57And then boom, in your app, suddenly there's a place where the user can select that.
- 43:02And if they do change it, what happens is the app runs from top to bottom.
- 43:07And at that exact moment when that call happens, we substitute 50 for whatever number the user typed in.
- 43:14I see.
- 43:14So the function is basically rerun.
- 43:17That's right.
- 43:17It's sort of been seeded to say, if they ask, tell them it was this.
- 43:21Okay.
- 43:22That's exactly right.
- 43:23So the script is rerun.
- 43:25And so as a result of that, it is helpful if your scripts run quickly.
- 43:31And so we...
- 43:33It's a true statement, but if you're going to rerun it a lot, it's really helpful.
- 43:37Exactly.
- 43:37Exactly.
- 43:38And so we provide a bunch of primitives that help you sort of reuse bits of your script
- 43:44so that from the previous run, so that it does run quickly.
- 43:47Yeah.
- 43:48I did notice that from the code there, that there's a lot of caching type of things, but I didn't
- 43:55realize that it was to facilitate what you're talking about here.
- 43:59Yeah.
- 44:00So you can go to a lot of these functions and you can put a decorator, a cache decorator,
- 44:04and you can even say show spinner true, show spinner false.
- 44:07Here's the hashing function to determine if the input is the same or not the same.
- 44:12It feels a little bit like the functools LRU cache last recent, yeah, the LRU cache.
- 44:17Yeah.
- 44:18To basically just say, look at the arguments.
- 44:20If the input's the same, then when you already have the output just here.
- 44:23Yeah, that's right.
- 44:24That's exactly right.
- 44:24So it is very, it is exactly that idea, which for CS nerds out there is also called memoization.
- 44:32And it really, it comes down to a super simple idea, which is you write a little function
- 44:38and it takes some arc inputs and it gives you back some outputs.
- 44:42And then you decorate it with this little Python decorator.
- 44:46And then lo and behold, if you run it again on the same inputs, it just returns the same
- 44:52output without actually doing the computation.
- 44:53And that's a very useful thing in general.
- 44:56And it's a very useful thing in particular in Streamlit because it lets you write these
- 45:00much more performant apps.
- 45:02It's also, I would say, one of the greatest sources of confusion about how Streamlit works.
- 45:09You know, as people who are really trying to create easy and simple to understand tools,
- 45:15it is a source of some degree of chagrin and embarrassment for us that this part of Streamlit
- 45:22is a little bit complicated.
- 45:23And so we have been working on a bunch of other simpler abstractions that we're going to release
- 45:32that will hopefully make this easier to understand.
- 45:34Cool.
- 45:34Yeah.
- 45:34So maybe that's a good place to talk about the future.
- 45:37You wrote, you published a roadmap for 2020.
- 45:39Yeah.
- 45:39Yeah, yeah, yeah, yeah.
- 45:40There's two basic things that we're working on.
- 45:44So one of them is Streamlit for Teams.
- 45:47And so that is the sort of auto deploy version of Streamlit.
- 45:51And that lets you basically just check, you know, your apps into GitHub and then deploy
- 45:56them instantly.
- 45:57And in fact, we are planning to release a version such that if your app is open source on GitHub,
- 46:04you get some amount of free hosting, which we're just super, super excited about.
- 46:09Yeah.
- 46:09So you're basically trying to leverage GitHub's actions and notifications to just do continuous
- 46:15deployment.
- 46:16All they're going to do is just commit it, right?
- 46:18That's right.
- 46:18That's right.
- 46:18That's right.
- 46:19Yeah.
- 46:19Yeah.
- 46:19We're really excited about that.
- 46:21It's, there's a lot of sort of community apps that people put out there for the benefit
- 46:26of others.
- 46:26And we just feel like this is going to just totally unblock that workflow and make it really
- 46:31simple.
- 46:31Yeah.
- 46:31You're really trying to sneak in some of these like proper CS ideas for non-TSP.
- 46:37Yeah.
- 46:37Yeah.
- 46:37Yeah.
- 46:38Yeah.
- 46:38You could just do simple scripts, but you're going to have to set up a GitHub repo and you
- 46:42have to use service control.
- 46:42Oh, you can just like put whatever, but you probably should have a few functions, right?
- 46:46Yeah.
- 46:47Nudge, nudge.
- 46:47It's cool.
- 46:48Hey, I love, I love that you say that.
- 46:50I think that's, I think that there's a very much element of truth to that.
- 46:53But, you know, it goes both ways too.
- 46:56We talk to, so, so, so Streamlitz really caught on in the, in like the enterprise, basically
- 47:01much, you know, in some ways to our surprise how fast.
- 47:04And so we've, we've talked to the data science teams from like 7-Eleven, Caterpillar and all
- 47:09these companies.
- 47:09And one of the things that we asked them is like, do you guys use source control?
- 47:13And often basically the answer is yes, or it's no, but we want to.
- 47:19So in a sense, I don't think we view this prescriptively so much as we think this is really where
- 47:25things are going anyway.
- 47:26And also we want to use the best tools out there and we want to weave them together.
- 47:33That's, I think all the, you know, basically if you look through the GitHub, I mean, if
- 47:37you look through the Streamlitz source code, it's almost like a roadmap of the coolest tools
- 47:41in Python and then out there in the world.
- 47:43And so React and all this stuff.
- 47:45So we want to weave those together, you know, using the best possible tools in 2020.
- 47:50And from our perspective, Git, which is not just GitHub, it's also GitLab.
- 47:55And, you know, there's many incarnations is these are amazing, amazing tools that hugely
- 48:02make people more productive, actually, once you understand them.
- 48:05So being able to embrace them and not reinvent the wheel, but rather be sort of get out of
- 48:12the way and let them do their magic is totally part of the Streamlitz.
- 48:15Yeah, that's cool.
- 48:16Other stuff you got on the roadmap, improved caching, which you just spoke a little bit
- 48:21about some plugins, layout.
- 48:23You've talked a little bit about that as well.
- 48:25Yeah, yeah.
- 48:26And then user programmable state is in for multi-page apps.
- 48:29All those things sound very useful.
- 48:31So I think right now, the experience that people have of Streamlit is this thing is awesome.
- 48:39If I have this specific use case, which is an app with sliders, and you know, I don't care too much about the layout.
- 48:45And if that's what you want to do, then Streamlit is just super cool.
- 48:50But there are limits to that framework.
- 48:55There are in terms of what's possible.
- 48:57And we believe that we can sort of relax those limits to the point that Streamlit is really the best general purpose app framework for machine learning and data science.
- 49:09But in order to do that, we need to think really carefully about how to introduce new sort of app abstractions like state into Streamlit really carefully so that it maintains that simplicity that people like, but gives you a little bit more power.
- 49:24So the goal for 2020 is to roll out sort of the zeros of each one of these pieces of the puzzle so that by the end of the year, people can say with some degree of confidence, hey, you know, I can build this app.
- 49:37It's going to go all the way.
- 49:38Sure.
- 49:38That's a great mission.
- 49:40What's the story on authorization, authentication?
- 49:44Oh, yeah.
- 49:44I would like somebody to interact with this app, but I wanted to remember for them what they did or something like that.
- 49:50That is part of the paid product.
- 49:52People who want to create it themselves in an open source, purely open source way are welcome to do that.
- 49:58But we're going to basically create really simple deployment that gives you that functionality sort of with a couple of clicks.
- 50:06So you can say scope it to these people or scope it to my company or use this existing identity provider, SAML or whatnot.
- 50:14And then basically create an app that is scoped to a certain number of users, both in terms of accessing the source code and also in terms of who can use the app.
- 50:22Sure.
- 50:23Okay, cool.
- 50:23Well, Adrian, we're getting long on time here, but this has been really fun to talk about.
- 50:27There's two quick things I just want to touch on before we move on.
- 50:31One is we were talking a little bit before we hit record and how, like many companies, you guys are finding yourself reinventing yourself as a remote company.
- 50:41Yeah.
- 50:42How's that going?
- 50:42I have to say that it has been a really interesting and instructive experience.
- 50:48And as much as I find the whole COVID-19 very scary and I worry about my parents and my fiance's parents and all of our...
- 51:00And we're getting a little stir crazy being at home all day long.
- 51:05It's also a silver lining is that we've had to really think about how to build a company that works asynchronously.
- 51:13We use Notion all the time, which is like the coolest app of all time.
- 51:17We use Streamlitz to coordinate things.
- 51:19And it's been an amazing experience.
- 51:22And I think we're going to...
- 51:24We've actually made a decision to start hiring anywhere in the US now instead of just in San Francisco.
- 51:29I'm just so excited about that.
- 51:32I mean, we recognize that there's so much talent everywhere.
- 51:36And we really just assumed that we all had to be in the same room.
- 51:42And I think that these past couple of weeks have kind of shattered that assumption, which is kind of mind-blowing.
- 51:47Yeah.
- 51:47Boy, it's a tough time in a lot of ways.
- 51:50But it's also, I think, shaken up everybody's assumptions about reality for work, for family, for even simple stuff like food.
- 52:02Right?
- 52:02We used to get takeout a lot and whatnot.
- 52:04And we're like, all right, well, we're just going to have to start making more interesting food.
- 52:07So I cooked a really good dinner last night.
- 52:10Totally.
- 52:11But it's like...
- 52:12Totally.
- 52:12It's just all these different stages or parts of our life are just like, shake, shake, shake.
- 52:17Let's see what, you know, shakes out what we really need or what really is the right fit.
- 52:22And so it's really cool to hear that you guys are finding a silver lining in it.
- 52:25Yeah.
- 52:25Yeah.
- 52:27One other one is that my son, who's eight, now he has like literally three playdates a day over like Google Hangouts.
- 52:35Like he plays like, you know, Fortnite and then he plays Minecraft.
- 52:39And it's like, he has a whole new social life that he never had before.
- 52:44And he actually told me the other day, he's like, I'm sad.
- 52:46I'm going to be sad when COVID is done because I want to have all these playdates over Hangouts with all my friends.
- 52:51And I was like, you know what?
- 52:52You still can.
- 52:53That's never going to go away.
- 52:55We just, we just figured out how to do that and you'll have it forever.
- 52:58Yeah.
- 52:58Yeah.
- 52:59That's really cool.
- 52:59My daughter's definitely been doing that as well.
- 53:01Like she'll sit down at the Xbox with her friend and like prop up, you know, an iPad next to her.
- 53:06You see, I'm feeding this character and they're doing the same.
- 53:09And you know, it's like, it's, it's pretty neat in that regard.
- 53:13The other thing I want to touch on, something I'm a big fan of, and I just learned about reading your bio that you were involved in,
- 53:22is the Lo and Behold documentary by Van Rietzog.
- 53:26Yeah.
- 53:26For people who have not seen Lo and Behold, it is an incredible documentary on the history of the internet and technology in that era.
- 53:34Yeah.
- 53:35What was your involvement there?
- 53:36That sounds fun.
- 53:37I was interviewed as one of the sort of like internet pioneers because of my work with Foldit.
- 53:43I was probably like the least famous person by far that day because it was like Elon Musk and all these people.
- 53:50So I'm sure that they, when they watched it, they were like, who's this, you know, who's this guy?
- 53:55But it was because I folded.
- 53:56And you know, one of the coolest things for me was being able to meet Werner Herzog, who's just like, you know, he has a sort of shamanistic way of being in the world.
- 54:05And so, you know, he gave me advice like, Adrian, if you want to understand some part of the world, you must walk through it on two feet.
- 54:14How cool.
- 54:17Stuff like that.
- 54:17So I was like, it was really cool meeting him.
- 54:19And obviously it's a legendary filmmaker.
- 54:21Yeah.
- 54:22Oh, how cool.
- 54:23I just, if you were looking to watch something interesting, lo and behold, it's a fantastic option there.
- 54:28Yeah.
- 54:29All right.
- 54:29Well, final two questions before I let you out of here.
- 54:31If you're going to work on Streamlit or other Python code, what editor do you use?
- 54:37Oh, VS Code all the way.
- 54:39All right.
- 54:39Right on.
- 54:40Although, although I've tried in COVID, one of my little side projects has been to try to figure out how to code on my iPad.
- 54:48Oh, yeah.
- 54:48And so now I'm, and if anyone knows like how to do this, like tweet me your secrets, because I'm like really trying to figure this out just kind of for fun.
- 54:56But on the iPad, there is no VS Code.
- 54:58So I would love if there were VS Code and please someone make that happen.
- 55:03I'll give you two things that you can play with that I know about.
- 55:06I'm sure listeners, they can put it at the bottom of the show notes, the comments on the episode page and we'll make sure you get those as well.
- 55:13Yeah.
- 55:13But one is Carnet, C-A-R-N-E-T-S.
- 55:17Oh.
- 55:18It's local Jupyter Notebooks for iOS, like no network everything, which is, if you're willing to do notebooks, it's JupyterLab on your iPad.
- 55:28That's awesome.
- 55:29It's pretty cool.
- 55:31I think it might even be open source.
- 55:32I'm not sure.
- 55:33And then you can set up Visual Studio Code online.
- 55:38So Visual Studio online.
- 55:39And then run that.
- 55:41I think you can run that in your web browser and basically get VS Code.
- 55:45I've been trying to do that and I cannot get it to work.
- 55:48Is it working?
- 55:48Yeah.
- 55:49I can.
- 55:50It doesn't.
- 55:51The iPad browser just doesn't quite like have it.
- 55:56It's missing a couple of things that.
- 55:58So I've been, that's been my, I've been trying to do that.
- 56:00And maybe I'm getting something wrong.
- 56:02So anyway.
- 56:03Maybe.
- 56:03I do feel like that's actually one of the big mistakes that Apple has made is not allowing any innovation on web browsers on their platform.
- 56:13Totally.
- 56:13That's just bizarre to me.
- 56:14So anyway.
- 56:15Yeah.
- 56:16Yeah.
- 56:16Cool.
- 56:16Cool.
- 56:17All right.
- 56:17And then notable PyPI package.
- 56:20Something, some Python package that you're like, maybe it's not the most popular, but like, wow, people should know about this.
- 56:25And I mean, obviously, if it's all streamlet is one option, but if it's anything else that comes to mind, I guess, I don't know how I'm famous.
- 56:33This is.
- 56:34I think it's semi-famous, but I would really get tell people that I want to shout out to Altair.
- 56:39Basically, you know, a lot of people know Matplotlib.
- 56:42A lot of people know Plotly.
- 56:43A lot of people know Bokeh.
- 56:45I think Altair is a little less famous.
- 56:47The short story is they took D3, which is this legendary thing.
- 56:51They simplified it into a declarative JSON language called Vega, but that was way too complicated.
- 56:57So they simplified that into an even simpler language called Vega Lite.
- 57:00And then someone created, at Google, created Python bindings for that, and it's called Altair.
- 57:05And this thing, it's its own philosophy, man.
- 57:09But when you learn it, it is so cool and creates beautiful graphs and they're interactive and they just look great and they're easy to create.
- 57:17And I just think Altair is great.
- 57:19Awesome.
- 57:19Yeah, I've definitely heard good things from Altair.
- 57:21Yeah.
- 57:22About Altair.
- 57:22So a good recommendation.
- 57:23All right, Adrian.
- 57:25Final call to action.
- 57:26People are excited about Streamlit.
- 57:27Want to check it out.
- 57:28Do more with it.
- 57:29What do you say?
- 57:29Go for it.
- 57:30Super fun.
- 57:31Streamlit.io or just pip install Streamlit.
- 57:34And then type Streamlit that hello on the command line and you'll be playing with interactive stuff in minutes.
- 57:40Well, thanks for being on the show.
- 57:42It's been really great to talk to you about your project.
- 57:43Yeah.
- 57:44Thanks so much, Mike.
- 57:45I really appreciate it.
- 57:46You're welcome.
- 57:46Bye-bye.
- 57:46All right.
- 57:47Take care.
- 57:47Bye.
- 57:47This has been another episode of Talk Python To Me.
- 57:51Our guest on this episode is Adrian Troiel.
- 57:54And it's been brought to you by Linode and Reuven Lerner's Ace Python Interviews course.
- 57:58Start your next Python project on Linode's state-of-the-art cloud service.
- 58:03Just visit talkpython.fm/Linode.
- 58:06L-I-N-O-D-E.
- 58:07You'll automatically get a $20 credit when you create a new account.
- 58:11Ace that Python interview.
- 58:13Let Reuven Lerner's course help you get that next Python job.
- 58:17Just visit talkpython.fm/ace to take his free course.
- 58:22Want to level up your Python?
- 58:24If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 58:29Or if you're looking for something more advanced, check out our new async course that digs into all the different types of async programming you can do in Python.
- 58:37And of course, if you're interested in more than one of these, be sure to check out our Everything Bundle.
- 58:42It's like a subscription that never expires.
- 58:44Be sure to subscribe to the show.
- 58:46Open your favorite podcatcher and search for Python.
- 58:48We should be right at the top.
- 58:49You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
- 58:59This is your host, Michael Kennedy.
- 59:00Thanks so much for listening.
- 59:02I really appreciate it.
- 59:03Now get out there and write some Python code.
- 59:05I really appreciate it.