Learn Python with Talk Python's 270 hours of courses

#260: From basic script to interactive data sci app with Streamlit Transcript

Recorded on Thursday, Apr 9, 2020.

00:00 If you work on the data science or data visualization side of Python, you may have come to it from a

00:05 scripting side of things, writing just a little Python using its magical libraries with little

00:11 structure or formalism to build a powerful analysis tool that runs in the terminal or

00:16 maybe even in a Jupyter notebook. What if you could take that same code, sprinkle in a bit of

00:22 a simple API and turn it into a fast and dynamic single page web application that allows your users

00:28 to dive into the visualizations right there in the app? Well, that's basically what the folks over at

00:34 Streamlit created, and we're going to dive into it with one of the creators, Adrian Truel.

00:38 This is Talk Python to Me, episode 260, recorded April 9th, 2020.

00:56 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem,

01:02 and the personalities. This is your host, Michael Kennedy. Follow me on Twitter where I'm at,

01:06 mkennedy. Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on

01:12 Twitter via at Talk Python. This episode is sponsored by Linode and Reuven Lerner's Ace Python interviews

01:19 course. Please check out what they're both offering during their segments. It really helps support the

01:23 show. Adrian, welcome to Talk Python to Me. Hey, Mike. So excited to be here. Thanks a lot for

01:29 inviting me on the show. Hey, it's super happy to have you here on the show. A ton of people reached

01:33 out to me when Streamlit was initially launched saying, there's this new thing. It has changed my

01:39 world. You have to talk to the people behind it. And so now I'm excited to talk to the people behind it.

01:45 Yeah, totally. It's awesome to hear that. And, you know, definitely for someone who's spent a lot of

01:52 time, you know, in a room programming alone, it's really cool to have made something and hear people

01:58 say, this is awesome. This, this, you know, really changed my life and my work. So that's great to hear.

02:03 Yeah, it's a super cool product. And I think it's going to be fun to talk about. It really enables

02:09 data scientists to get certain types of computation out there in a way that people can interact with.

02:16 So I'm very excited to talk about it, where it came from, some of the technology inside of it and

02:21 whatnot. But let's get started with your story. How'd you get into programming in Python?

02:25 My story is that it's never too late to become a programmer. I actually went to college to study

02:31 international relations. I was, came from a bilingual family and I, you know, I figured out I should do

02:36 politics or something like that. Right. Leverage your bilingualism, right? What languages did you,

02:41 do you speak? Well, okay. So my dad's French. So I grew up speaking French and English and we were,

02:47 and then, you know, being, you know, growing up in the U S I'm surprising that I took Spanish.

02:51 And then actually when I got to college, I took Chinese. So, you know, I didn't come from a family

02:59 that really respected like programming and that kind of thing. And so it wasn't part of my world. And I

03:04 feel kind of envious of kids who grew up, you know, went to science high schools and stuff,

03:08 because in retrospect, that's really who I was. But it wasn't until I got to college and about a

03:14 year and a half into studying international relations, I was like, this is not for me.

03:18 Actually, I always thought college might not be for me. And then this professor of economics remembered

03:25 me because I had blue hair. And he was like, you know, he said, Adrian, how are you doing? And I said,

03:30 well, you know, not so well, I'm not even sure if I should be here. And he said,

03:35 what you need to do is, he said, you're misallocated, which is a very economic way.

03:39 That's a very economic way to describe your situation.

03:42 Yeah, exactly. And so he was like, what you need to do is you need to study math and science. And I was,

03:48 you know, anyway, I thought that that was ridiculous, literally, but I took him up on his offer.

03:54 And it calc one, my sophomore year of college took intro to programming, was like blown away. It was

04:01 like, these are my people, this is my work. And I'm just so grateful. I found it. Oh, my God. I mean,

04:07 wow, what a fun job to have. And what a fun world to be in. And also, this is back in the late 90s.

04:13 It wasn't 100% as obvious as it is today that this is like, generally, generationally changing for all

04:20 of culture. And obviously, it is everyone sees that now. And so I feel really lucky to have gotten in.

04:24 Yeah, how lucky that you had that interaction. And you found your place because I think a lot of people,

04:30 they don't find their place in the world, they find a place that they're comfortable with,

04:34 and they end up in a place that's okay.

04:36 Absolutely.

04:37 They don't wake up going, wow, I get to do this.

04:41 Yeah. And I really think, you know, being able to figuring out taking time to figure out like,

04:48 what you really would enjoy doing and trying a lot of different things. I just can't think of

04:54 anything more valuable. I really actually think the whole world is a little bit misallocated

04:59 to a certain extent. And if everyone can sort of play musical chairs and, you know, get the right job,

05:04 for a better job, we can just unleash like massive new economic potential. So,

05:09 you know, that's true for my life. It's also been part of actually a theme of my professional life as

05:14 well. So I can talk about that. But anyway, yeah, figuring out what you love to do is I think so

05:20 valuable. And I'm so grateful for that professor.

05:23 That's amazing. I do think there's a little bit, I don't know how to solve this. But I do think there's

05:28 a little bit of a mismatch, where people tell you, you have to find something that you're passionate

05:33 about, or you're not going to be happy in your career. I think that you find something that connects

05:40 with you. And you didn't even know that it was going to connect with you. And then you polish that

05:45 skill. And then you become very passionate and excited about it. So when you, I think when young

05:51 people hear advice, like you have to do what you're passionate about, like when you're young, and you

05:54 haven't had that exposure, like imagine you hadn't taken that math class, like, you weren't passionate

05:59 about math. It's not like you're like, well, get out of my way, you know, languages, I'm going to math,

06:04 right? There's a sort of chicken and egg thing. And I think it's really hard to unlock that potential

06:09 for a lot of people in general. I don't know. I don't know what to give people advice about that.

06:14 But it's it's I think it's interesting that it's important to do what you're passionate about. But like,

06:19 you got to somehow explore to get that figured out.

06:22 I agree. And I also think there may be different, there are different kinds of people, of course. And

06:28 I don't think necessarily being passionate about what you do is as important to other people as it

06:33 turns out it is to me. I don't want to over extrapolate either. But I do feel really grateful

06:39 for, you know, have been given that advice. And it's actually come up in a couple other ways in my life.

06:45 I created a game called Foldit that allowed hundreds of thousands of people to solve protein

06:51 folding problems when I was doing my PhD. I think I've heard of that. Yeah, I'm pretty sure I did hear

06:56 that. Yeah. So it was the gamification of trying to solve a protein folding problem. It wasn't like

07:03 SETI at home where it was like just grid computing, right? It was leveraging human creativity, not

07:08 distributed computing, right? Exactly. And that had sort of that theme. One of the coolest things about

07:14 that project was that a lot of people found out, hey, this is something that I love doing. And they

07:19 were able to contribute to society in like a new way that they've never experienced before. And so I

07:25 think for a lot of people, it sort of unlocked a little bit this, you know, new skill. Yeah.

07:30 And then coming to Streamlit, you know, what we are doing is building software that lets data

07:38 scientists and machine learning engineers, like productize their work without the need of anyone else to

07:43 help them so they can build apps that others can use. And again, I feel like for our users,

07:49 we're giving them like a new form of impact in the world and in their companies. And I think that's

07:56 where the passion comes from. So in a funny way, it does seem like a theme, both in my life personally,

08:02 and also in the products that I've been creating.

08:05 Yeah, absolutely. And so you went from not sure you should be at college to studying some math to

08:09 being a professor at Carnegie Mellon. That's a big, big U-turn.

08:13 Yeah, yeah, yeah, yeah, yeah. But you know, actually, in a funny way, the I don't think the

08:18 quest ended there. Because when I was a professor at Carnegie Mellon, there were some things that I

08:22 really loved about it. But I felt that I wasn't directly affecting the world the way I do now at

08:30 Streamlit. So and in a sense, we were doing super fascinating, very mathematical, big data stuff.

08:38 And it was from an intellectual standpoint, I mean, heaven to the power of heaven.

08:43 But I was missing that that other aspect of things, which is really, you know, having an audience beyond

08:52 a couple hundred experts in the world in some way. Both are totally valid and extremely important

08:58 forms of impact each in their own way. So I am a huge believer in academia, and it's important in

09:04 society. I personally wanted a little bit more direct connection to the, you know, the quote,

09:10 unquote, the user. And that has taken me through a variety of different jobs at Google X, working on

09:19 self-driving cars at Zoox, and then finally starting Streamlit. And for the first time since I created

09:26 Foldit, I'm hearing people say, wow, this is really changing my life. And that's so exciting to have

09:32 created a product that has that property. It's amazing you've done it twice, right?

09:35 And with this, you've made something that's made a big impact for a lot of people.

09:40 It is really gratifying. And I think, you know, the gratifying part is to, first of all, it gets to,

09:46 you know, build cool things and work on cool ideas, but also just have other people feel like their jobs

09:53 are more interesting and more fun, and they're having more impact because of some piece of technology that

09:58 we've pulled out. And so I think that's just great. I think that's just so exciting.

10:03 I agree. So today, day to day, you're working at Streamlit with Thiago and Amanda, your co-founders,

10:10 and I'm guessing some other folks on the team. What kind of work are you doing there?

10:13 Okay, so we're about nine people, and we're about 18, including contractors, and we are hiring a lot

10:20 all across the United States. And we are basically building two products, one of which is Streamlit,

10:28 and the other of which is Streamlit for Teams, which allows people to build data apps really

10:36 quickly in Python. Streamlit for Teams allows them to deploy it really easily, and so that others can

10:41 use it. And then my day is pretty much, well, my dream day is pretty much I'm chatting with the

10:50 engineers and working on design docs and thinking about cool problems. Somehow that's like very rarely

10:56 my actual day. I don't know how it happens, but my actual day is often just like meetings,

11:01 meetings, meetings, meetings, meetings, talking with investors. I don't know, thinking about

11:05 payroll stuff and not sure how, despite my effort over years to make that not be the case, that is

11:13 still the case, but that is still the case.

11:16 Here you find yourself, but you know, that's kind of what it takes to get some of the stuff going,

11:21 right? So yeah, totally, totally. Yeah. And I think, you know, ultimately what has made Streamlit

11:29 great has not actually been my ideas per se, but really actually the ideas of the community

11:37 and also of the engineers working on it. And so I try to remember that even though I have a dream job

11:44 of working on every aspect of the product, probably for everyone else's benefit, I should just get out of

11:49 the way and let them do the magic. Yeah. That sometimes is how it is, right? It's just let

11:53 let the people do the work, even though it would be very fun. Now I want to get into some of the

12:00 origins and whatnot, but I also just want to set the stage as people are listening, because this was

12:04 something I was not entirely clear about as well. Yeah. So you spoke about Streamlit, the tool for

12:11 building interactive UIs around data science, and you spoke about Streamlit for teams, talked about hiring

12:16 people. So obviously this is a business venture. Yeah. The status, which is great. I'm super supportive

12:22 of you guys. That's awesome. But I just want people to realize that Streamlit, the tooling in the library

12:28 is an open source thing that you can use. And the teams thing is like a cloud computing service that is

12:35 part of the business. Is that, am I understanding that right? Yeah, that's exactly right. And speaking of

12:39 the origin story, it wasn't actually meant to be a business. It was really a side project and it was

12:46 going to just be an open source project. But what happened was a bunch of people at really big companies

12:54 like Stitch Fix started using it. And then we realized, hey, there is actually a business model

13:00 here. And so the picture started, in a sense, it all kind of snowballed from what was really first,

13:05 just a personal project, me at home, coding all day long. And my mom saying, hey, you need to figure out a way

13:12 to 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:17 And so, yeah, there's actually a very simple breakdown in terms of the open source and the business part,

13:25 which is open source is lets you build data apps super quickly and easily. It's free, always will be free.

13:33 Apache 2 license. It's a real open source project. Everything's up on GitHub. The community contributes a lot.

13:38 We build it a lot and maintain it. So that's the open source part of the project.

13:42 The closed source part of the project lets you take your streamlit apps and deploy them really easily on our cloud.

13:50 You'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:56 And we totally support that aspect of the community. So there will always be a way to create and deploy streamlit apps

14:02 for free using only open source tools. But we also recognize that a lot of our users and especially corporate users

14:09 are asking for a simpler solution to that side of things, the deployment, not the app building.

14:14 Well, 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:23 and problem solving into an interactive web app really easy. And so the last thing you probably want to do is like,

14:30 well, that was cool. Now you need to figure out Nginx. You need to figure out SSL. You need to figure out cache.

14:35 You need to figure out Linux maintenance, et cetera, et cetera.

14:37 Exactly.

14:38 I think it's a reasonable thing to do for sure.

14:40 Yeah. I think that the experience that our users have is they download Streamlit. So pip install Streamlit,

14:48 follow the tutorial, literally within 30 seconds, they have an app that they're playing around with. Within

14:55 five minutes, they've created their own and there's a little button or something. And I think that what we

15:01 hope for is delight. But then it comes to, I want to share this with others.

15:07 And you go into the, you search around on Google and it's literally starts to become,

15:12 you know, create a GCP instance, copy your SSH keys into it. I'll tell you, that's a nerve wracking

15:21 experience to actually try to put something on the web and have it secure and everything. So we want

15:27 to bring that delight to the deploy as well. And that's kind of the picture.

15:33 This portion of Talk Python to Me is brought to you by Linode. Whether you're working on a personal

15:37 project or managing your enterprise's infrastructure, Linode has the pricing, support, and scale that you

15:42 need to take your project to the next level. With 11 data centers worldwide, including their newest

15:47 data center in Sydney, Australia, enterprise grade hardware, S3 compatible storage, and the next

15:54 generation network, Linode delivers the performance that you expect at a price that you don't.

15:59 Get started on Linode today with a $20 credit and you get access to native SSD storage, a 40 gigabit

16:05 network, industry leading processors, their revamped cloud manager at cloud.linode.com,

16:11 root access to your server, along with their newest API and a Python CLI. Just visit talkpython.fm

16:17 slash Linode when creating a new Linode account, and you'll automatically get $20 credit for your next

16:23 project. Oh, and one last thing, they're hiring. Go to linode.com slash careers to find out more.

16:28 Let them know that we sent you.

16:30 I haven't interacted with the deployment side of things, but I can tell you that the web app side,

16:36 it's got a little bit of magic. So let's get into that, but let's start at maybe the predecessor,

16:43 right? A lot of people are coming into Python these days. This is my assessment of looking out at the

16:50 world. They're coming into Python for a little bit of computational scripting. I hate to call it

16:57 scripting because when people say, Oh, Python's a scripting language. It's like,

17:00 yeah, but you also, it's a programming language that supports scripting, right? Like it's,

17:04 there are a lot of people who they don't care about computer science. They definitely don't think of

17:12 themselves as programmers. They think of themselves as economists, biologists, whatever. But they're like,

17:20 I 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:24 throw it into this. I've learned that if I use Jupyter, I type these five lines using this library,

17:29 no functions in sight, you know, no unit tests, none of that. Just like I do these,

17:34 these five or 10 lines in order. Then I have this really cool power. And then they get sucked into

17:40 Python, right? Like, yeah, they could do a little more and a little more. And like, eventually they look

17:44 back and like, wait, I'm programming. How did I become a programmer? Which is great. But I think

17:49 like where you guys are aiming is that audience a little bit, right? The people who are like,

17:57 I can put this together in kind of a top to bottom flow of computation and generate results,

18:02 but I need more than that, but I'm not a programmer. Would you say that's fair?

18:06 Yeah, that's exactly right. So we really embrace Python as a scripting language. That's the core of

18:15 Streamlit. And we embrace the ethos of let's write code from top to bottom that does something simple,

18:24 that's easy to understand and read. And that really gives you a huge amount of power for,

18:32 you know, a huge amount of bang for your buck. I mean, that's what Python is, right? You know,

18:36 how do I, how do I download some information off the web requests package, boom, boom, boom,

18:42 all of a sudden it's happening. And I think actually Python programmers, myself very much included,

18:48 are like shocked when you go to another programming language and you're like, oh, I, yeah, totally.

18:52 You know, we just, you do, you know, do all these things. And then you're like, oh my God,

18:57 this is impossibly difficult. How are these people doing this? You know? So there is still,

19:04 I mean, it's an old, it's getting to be an old language and yet there's this magic to it. And

19:07 there's this bang for the buck that it's just unparalleled. And, and Streamlit is grounded in

19:13 that observation and in that ethos, which is let's write script and let's extend Python in a new

19:21 direction, which is really being able to write web apps, especially data web apps that capture something

19:27 about what you've done as a data scientist or a machine learning engineer and allows lots of people to play with it

19:33 use it and understand it and actually become part of business processes. And,

19:37 yeah.

19:37 And we've seen, you know, become part of the fabric of your company or of your group or of the world.

19:43 People are creating lots of COVID apps, for example, both to teach other people about coronavirus,

19:49 but also in some cases, the University of Penn hospitals released a Streamlit app to allow

19:55 other hospitals to predict how many beds they need.

19:57 Yeah. That's very useful, right? That's taking the models and applying them for,

20:01 you're going to need to get five more or something like that. Right. Very concrete.

20:05 Exactly. Exactly. Very concrete. And very much sort of the next step in data science beyond just,

20:12 you know, I've created a graph once for, to paste into a, you know, spreadsheet or into a presentation.

20:18 It'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:24 I use it, I should say. And then, and then how can we do that without embracing this scripting ethos?

20:31 We 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:38 And I think the capturing that magic is what has caused so many people to get excited by it.

20:45 Yeah, 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:54 So 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:03 but they're not, not like super advanced. Right. So it feels like they're almost kind of organized,

21:08 like someone might organize a notebook for scripting, but it's a little bit more formal than a tiny bit more formal than that.

21:15 But what you gain on the other side is like tons of interactivity, which is pretty cool.

21:19 So when you look at the Streamlit, you guys talk about it, you say, basically the goal is to bring three things together.

21:26 The Python scripting, which we talked about. The next one is interaction to basically make this an interactive thing for users,

21:34 more or less the productization of that stuff. Right. So users can play with it, not just developers.

21:40 And the final bit is deployment that we've kind of touched on, but we haven't talked very much about the interactive bit,

21:46 which I think is also some of the magic because honestly, I look at this and I don't necessarily fully understand it

21:52 because I've written a lot of GUI applications. I've written 3D simulators and whatnot.

21:58 And I, you know, I wasn't super great at it, but I know what the code looks like.

22:03 I've done tons of GUI apps with, with callbacks and whatnot.

22:07 Yeah.

22:08 You seem to have been able to achieve those types of things without loops and without explicit,

22:17 how this button event wires up to this callback and all that async kind of stuff that's so common around UI.

22:24 So maybe we should talk about the interaction bit.

22:26 That's exactly right. The ethos of scripting is basically, I'm going to write a script that,

22:32 you know, loads some data, transforms it, does some other stuff, and then it's done.

22:37 The ethos of app development is totally different. It's, I'm going to declare a bunch of widgets on the screen.

22:45 I'm going to wire them up with callbacks. I'm going to have state that changes over time.

22:49 I'm going to be interacting with the web and have premises and stuff.

22:54 It is a truly different form of programming fundamentally and typically requires a lot of time to do even fairly small things.

23:06 I mean, that's, you know, it's not easy to build an app actually.

23:09 At a minimum, it takes a different way of thinking about programming that is not just like these 10 lines, right?

23:14 That's exactly right. It's a different way of thinking about programming.

23:17 And we really tried to ask ourselves, how could we make writing an app as simple as writing a script?

23:28 And so we give the Streamlit programmer a very, very simple to understand paradigm,

23:37 which is basically like sort of a cross between just a fancy print statement.

23:44 So, you know, in Python, you can always just say print, blah, blah, blah.

23:47 And then that gives you an ability to see what's going on and understand.

23:51 Right. If you want to level it up, you put some colorama in there and like make it.

23:55 Yeah, 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:02 you can start doing some visual output.

24:04 So we basically give you that as a basic primitive.

24:07 It's called S-T Streamlit dot write, R-I-T-E.

24:12 And then you can just plop anything you want in there and it pops up on your web browser in order.

24:16 And 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:24 We've got a whole bunch of widgets, you know, sliders, text boxes and whatnot.

24:28 And that pops up on the screen.

24:30 And then we wire it all together so that if the user types or changes anything on the web browser,

24:38 that gets reflected back in your code instantly without having to do any work.

24:42 And so the model is just so simple to understand and therefore so productive.

24:49 And we want to bring that Python simplicity and that Python magic to the app building process

24:56 and make it so that others can just build apps really easily.

24:59 Probably the best way to give people a sense of this is maybe to walk through an example.

25:04 You guys have a couple of example bits of code out there.

25:08 And right at the beginning, you go to the Streamlit website, Streamlit dot IO.

25:13 You can go down a little bit.

25:14 There's like a get started, just pip install Streamlit and a few other things.

25:19 And then there's an example that you can just run that comes with it.

25:24 And this has to do with stealth driving cars, which you and your co-founders have a lot of background in self-driving cars.

25:30 Yeah, yeah.

25:31 Which is kind of cool, right?

25:32 Totally.

25:32 So the idea is there's a lot of image processing that goes on around identifying people, other cars, bikers,

25:40 certain tolerances of whether or not that is a biker or not, and so on.

25:45 And so you can basically get this demo and explore those.

25:50 You say, I'd like to have up to five, but no more than six pedestrians on the screen.

25:55 And then I want to test like parameters around it and stuff, right?

25:58 Yeah, that's exactly right.

25:59 So this is a problem that comes up in the self-driving car industry.

26:04 Really, it comes up in all machine learning and all data science.

26:08 In my experience, I've seen this again and again across groups at Google,

26:14 self-driving cars, companies across the country, which are now using Streamlit and telling us what their challenges are.

26:20 And so it's really a perfect example of a simple Streamlit app, which is I have a whole bunch of data, domain specific,

26:29 and I need a way to be able to browse through it and understand what's going on.

26:34 And I might need to look through it.

26:36 I might need to maybe run some models on it and or blend a couple of different data sets together.

26:43 And 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:53 So 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:03 And at a certain point, even understanding all the data that you have becomes really complicated.

27:08 And 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:15 And so you eventually build an app to allow many different stakeholders to see and understand this data.

27:23 And so we built this app to illustrate how that can be done in Streamlit.

27:27 It uses the Udacity self-driving car data set as an underlying data set, lets you visualize where there are pedestrians and cars.

27:36 It even lets you run a neural net in real time.

27:38 And the entire app is built in 300 lines of Streamlit from top to bottom.

27:43 There's also like 50 lines of comments.

27:45 So I would say.

27:45 Yeah, yeah, yeah.

27:47 Yeah, it's 300 lines.

27:48 And 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:53 Like the 300 lines includes like a huge like Apache 2 license and a lot of comments.

28:00 And yeah.

28:01 So in fact, I think there's only like 20 some odd function calls, Streamlit function calls in the entire program.

28:08 So everything else, basically, this very, very rich app is created in.

28:15 20 function calls and everything else or let's call it 25.

28:18 Everything else is just pure data.

28:20 So 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:32 Yeah.

28:32 So let me do two things.

28:33 Let me describe a little bit of what this app looks like when it's running so people get a sense.

28:38 So when you run the app, you get a web page that is running on its own little local Streamlit server.

28:44 And on the left, you get a sidebar that lets you basically do the user interaction, right?

28:49 Like I can say, what type of object am I looking for?

28:53 And then how many of those objects and depending on what you get, you can have like different types of confidence and whatnot.

28:59 So there's this sort of cool interactive slider thing on the left.

29:02 And 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:11 Right.

29:11 That's exactly right.

29:13 Yeah.

29:13 And so, you know, it's all the basic elements of Streamlit are there.

29:17 So you get some user input.

29:19 Right.

29:19 And so if I change like the dropdown or I change the slider as a user, talk about the user input, right?

29:25 Then that automatically is reflected back in the changing views of the graphs or the detection of the picture.

29:32 So that's a super cool type of dynamic interactive web app.

29:37 It's not posting back the page.

29:39 It's like a JavaScript spa type of application you would expect.

29:43 That's exactly right.

29:44 That's exactly right.

29:45 Yeah.

29:45 And, 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:53 But 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:07 And, you know, interactions with databases and, you know, interactions with databases and they go both ways.

30:12 So it's really the sky's the sky's the limit.

30:15 It is actually possible to build, you know, production quality apps used by many people fully in Streamlit.

30:23 And, 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:38 Like, you know, Flask and then CSS, JavaScript, HTML, React, whatever it is.

30:43 That we love those tools.

30:45 For that matter, we wrote Streamlit in those tools.

30:48 So we really love them.

30:49 But 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:57 And it's really fun to not have to.

31:00 And you can do a lot.

31:03 Yeah, that's cool.

31:05 The 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:17 They say, OK, well, what you're going to do is you're going to work with our little widgets and our little libraries.

31:23 And the reason it's simple, because you don't need to learn about databases.

31:26 So you use our data library and it magically does data magic.

31:29 Right.

31:30 Right.

31:31 Yeah.

31:31 But right at the top you have of this example, you have import Altair, import Pandas, import NumPy, import OpenCV.

31:39 Right.

31:39 That's right.

31:40 I guess what I'm pointing out is like these are the tools that data scientists are already using.

31:45 They already know how to use and they're already like very effective and polished.

31:49 So it's not like, well, you can give up your Altair or your Bokeh and your Pandas and you could use our style.

31:55 Right.

31:56 That doesn't seem to be the story you're telling.

31:58 Yeah, that's right.

31:59 I think that there is a really interesting balance between simplicity, power and accessibility in regards to using other existing open source frameworks.

32:14 And one of the sort of strategies that some people have tried is we will be the platform.

32:21 We will define everything and you will live in our walled garden.

32:25 And that's how we'll make things quote unquote simple.

32:28 That's not really the ethos of open source.

32:30 Really, the ethos of open source is more like we're going to do one thing really, really well.

32:35 We'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:44 And that's the ethos of Streamlit.

32:47 We do one thing, which is let you build apps.

32:50 We try to do it the best in the world, of course.

32:52 And 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:04 The entire Python ecosystem is just directly available to you.

33:08 Yeah, that's really cool.

33:09 It also means you're not like super tied to Streamlit if you decide actually no or whatever, right?

33:14 Totally.

33:15 Exactly.

33:15 You could say we could do it in Notebook or we could try it in Streamlit and or not, right?

33:20 Like it's, I really appreciate about that, about what you built.

33:23 This portion of Talk Python to Me is sponsored by me, Reuben Lerner, and my free video course, Ace Python Interviews.

33:33 You know, one of the most stressful parts of a job interview is when they ask you to explain a concept

33:37 or to solve a problem with Python.

33:39 Ace Python Interviews contains six hours of screencasts solving 50 beginner, intermediate, and advanced Python problems.

33:47 You can even download the Jupyter Notebooks used in the screencasts.

33:50 Give yourself an edge when you next apply for a job.

33:53 Check out Ace Python Interviews for free at talkpython.fm/ace.

33:58 I still don't fully understand how the magic works.

34:03 So I want to talk people through it.

34:05 And then maybe you can tell me like, oh, here's where the magic is.

34:09 Yeah, for sure.

34:10 All right.

34:10 So let me talk through some of the code.

34:12 I just pulled out a few little examples of things that are interesting as you go through

34:15 that self-driving demo.

34:16 So let me run past you.

34:18 Yeah.

34:19 So first of all, like I already talked about this.

34:21 You have functions.

34:23 You've got a main function at the top.

34:25 And then you've got other functions like download the files, like go and get those self-driving car model

34:30 datas and the images and whatnot.

34:33 And you've got other functions for like showing what are some of them or like running one to like run the app,

34:42 one to select different parts of the UI, one.

34:45 Yeah.

34:46 And whatnot.

34:47 So you have this broken down like a well-structured script, I guess you would say.

34:53 Like it's all self-contained in this file.

34:54 It's not like a notebook exactly.

34:56 But it is broken to function.

34:58 So I appreciate that.

34:59 I also like the fact that you put the main method at the top and then it functions below.

35:04 I always see that in mind because here's the summary of what's happening.

35:07 Here's the details, right?

35:08 It always seems to be reversed a lot of times.

35:09 That drives me crazy.

35:10 Yeah.

35:11 But so first thing is like you want to have some message on the screen that is the UI of the web app.

35:17 And the way you do that is load a markdown file and parse it and render it using like one line,

35:23 like st.markdown.

35:26 Boom.

35:26 Give it a file name.

35:27 And then that's part like a portion of the UI is that, right?

35:30 Yeah, that's right.

35:31 There's a couple of cool things to note about that.

35:33 First of all, we do let you write well-structured code, quote unquote, well-structured code if you want.

35:39 Using names, functions and stuff is great.

35:42 You also don't have to.

35:44 It literally is just a Python script.

35:46 So you could get rid of all these function calls and just write it as a script from top to bottom.

35:50 And that works too.

35:50 And you get all the interaction and everything.

35:53 But we think it's cool that you get to write some function calls and structure your code that way.

35:57 And if nothing else, it actually mostly just helps describe what's going on to the user.

36:03 Which is one of the great properties of functions.

36:06 Then the other thing that you pointed out, which is true too, is that we've did in one line of code,

36:11 we've put a giant markdown file right on your browser.

36:14 And that's the instructions for how to use the app.

36:16 And that's pretty cool.

36:18 Yeah.

36:18 It's pretty simple.

36:19 And it does exactly what you expect.

36:21 And 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:29 And that's pretty simple also.

36:31 So it's a pretty cool little, yeah, it's a pretty simple little way to do things.

36:35 Yeah.

36:36 So that doesn't take over the whole screen.

36:38 That kind of just goes up there as like part of the UI.

36:40 And then you say, probably when you run it first, you don't have these files.

36:43 And they're like 400 megs, which is not a ton to download.

36:46 But they're not on a super fast server.

36:49 So they do take a little while to get down, actually.

36:51 Yeah, yeah.

36:52 And so what's really cool is you, you're just using requests and standard file IO to read and write them.

36:58 But as you're looping through that, reading off the stream, you have two simple lines.

37:04 You have a progress bar.

37:05 Yeah.

37:06 And you have like a text box area.

37:09 And you say progress bar dot progress.

37:12 And you give it like how far it is in the download.

37:14 And then you say the weights area.

37:16 You can say we're downloading this amount, you know, like five of 10, five of 400 megs.

37:21 Or whatever.

37:21 Yeah, yeah, yeah.

37:22 5.1, 5.2.

37:23 And as you're looping, you're changing those values.

37:27 And that is just dynamically changing the web app.

37:29 Yeah, yeah, yeah.

37:31 That's part of the magic right there for me, I think.

37:33 Oh, my God.

37:34 I'm so excited that you've been reading the code at this level.

37:38 I mean, what delight to talk about this.

37:40 Yeah.

37:41 So 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:47 Yeah.

37:47 Instead of saying print blah, you say st dot write blah.

37:51 And then you can just pop things on the web browser screen from top to bottom.

37:54 Markdown, data frames, graphs, anything you want.

37:57 But the next bit of magic is that those things that you put on the screen are not just stuck there.

38:03 You can reach out to any one of them and say, hey, I want to change you.

38:07 And for example, I want to take this progress bar and move it from 51% to 52%.

38:12 Or I want to take this text and I want to change it from foo to bar.

38:16 That ability to reach into the web page that you just created in pure Python and just update things is animation.

38:23 And 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:31 And it's really no more complicated than just writing a script.

38:37 Yeah.

38:37 And it looks to me like the visual layout story here is like kind of a column layout on the main screen.

38:46 So I just throw stuff into the UI.

38:48 Like I say, I want to dial, I want a text area.

38:52 So I just create a like a warning text area or whatever.

38:54 And I create a progress bar.

38:56 I just say I'm creating one and it just, it piles, it sort of visually piles up like one after another vertically.

39:02 Right.

39:02 So 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:09 It's kind of, you put them, there doesn't feel like I'm doing UI.

39:12 It kind of just figures it out.

39:14 I guess what I'm talking about.

39:15 Yeah, exactly.

39:16 The paradigm is just like a print statement.

39:18 It's just from top to bottom.

39:20 And this is a, you know, I think that's the right default behavior.

39:24 It's worth pointing out that the community has been saying for months, we want horizontal layout.

39:32 We want more control.

39:33 Yeah, yeah, no.

39:34 I just want to put something to the right or something else, not just below it.

39:37 And I want to say to all you programmers out there, we totally hear you.

39:44 We are super excited about horizontal layout.

39:47 It's coming.

39:48 It's in the lab.

39:49 We're working on some other really cool stuff like custom components that lets you insert your own custom widgets into the, into the streamlet page.

39:58 Those are coming first.

39:59 We're still a small team.

40:01 We're also really trying to hire as fast as possible, but, but, you know, great programmers.

40:07 So 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:13 Please give us some time.

40:14 And 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:20 Yeah.

40:20 Very cool.

40:20 It's awesome that you're hiring.

40:21 One other thing.

40:23 So I guess that I can see how that works.

40:24 So I have a progress bar.

40:25 I call progress.

40:26 It kicks off some asynchronous JavaScript event.

40:31 That's going to go over and tell that progress bar to update.

40:34 But 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:49 And I don't see anywhere, some kind of callback for when the slider changes.

40:54 I'm just getting that information.

40:55 Yeah.

40:56 And yeah, it's really interesting how the user interaction kind of comes back into the script.

41:02 Yeah.

41:03 Maybe 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:12 Yeah.

41:12 First of all, I'll point out that this was just a suggestion by a user.

41:15 And so this is an example of our user community really just having being the source of the best ideas in Streamlit.

41:22 And he said, hey, you just you should have a checkbox that should just be like, you know, the answer equals checkbox.

41:31 And that's how it should work.

41:32 That's blocking.

41:35 What am I going to do?

41:36 Like, that's impossible.

41:37 There's no way to do that.

41:38 But we then went back to the, you know, the whiteboard, basically, and we asked ourselves, how can we do just that?

41:44 And 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:57 So the widget type could be a checkbox and then the answer will be true or false.

42:00 It could be a text input and then the answer will be a string.

42:03 It could be a number input or a slider and you'll get numbers and so on and so forth.

42:07 You can even have file inputs.

42:09 You can get, we're working on a color clicker.

42:11 So there's a lot of cool stuff you can do.

42:12 Okay.

42:13 But 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:22 It's similar to like, if you had done like print, which of these three options do you want?

42:27 Input, parse it as an integer, right?

42:29 Like it's the blocking, it looks like blocking calls.

42:31 It looks like a blocking call.

42:32 Yeah.

42:32 And 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:42 And then you just keep coding, coding, coding, coding, coding.

42:44 And then you say to yourself, you know, hey, it would be really nice if someone could select the number of iterations.

42:48 I don't have to keep editing this text file.

42:50 So then you just go to that one line of code and you say number of iterations equals st.number input.

42:55 Default equals 50.

42:57 And then boom, in your app, suddenly there's a place where the user can select that.

43:02 And if they do change it, what happens is the app runs from top to bottom.

43:07 And at that exact moment when that call happens, we substitute 50 for whatever number the user typed in.

43:14 I see.

43:14 So the function is basically rerun.

43:17 That's right.

43:17 It's sort of been seeded to say, if they ask, tell them it was this.

43:21 Okay.

43:22 That's exactly right.

43:23 So the script is rerun.

43:25 And so as a result of that, it is helpful if your scripts run quickly.

43:31 And so we...

43:33 It's a true statement, but if you're going to rerun it a lot, it's really helpful.

43:37 Exactly.

43:37 Exactly.

43:38 And so we provide a bunch of primitives that help you sort of reuse bits of your script

43:44 so that from the previous run, so that it does run quickly.

43:47 Yeah.

43:48 I did notice that from the code there, that there's a lot of caching type of things, but I didn't

43:55 realize that it was to facilitate what you're talking about here.

43:59 Yeah.

44:00 So you can go to a lot of these functions and you can put a decorator, a cache decorator,

44:04 and you can even say show spinner true, show spinner false.

44:07 Here's the hashing function to determine if the input is the same or not the same.

44:12 It feels a little bit like the functools LRU cache last recent, yeah, the LRU cache.

44:17 Yeah.

44:18 To basically just say, look at the arguments.

44:20 If the input's the same, then when you already have the output just here.

44:23 Yeah, that's right.

44:24 That's exactly right.

44:24 So it is very, it is exactly that idea, which for CS nerds out there is also called memoization.

44:32 And it really, it comes down to a super simple idea, which is you write a little function

44:38 and it takes some arc inputs and it gives you back some outputs.

44:42 And then you decorate it with this little Python decorator.

44:46 And then lo and behold, if you run it again on the same inputs, it just returns the same

44:52 output without actually doing the computation.

44:53 And that's a very useful thing in general.

44:56 And it's a very useful thing in particular in Streamlit because it lets you write these

45:00 much more performant apps.

45:02 It's also, I would say, one of the greatest sources of confusion about how Streamlit works.

45:09 You know, as people who are really trying to create easy and simple to understand tools,

45:15 it is a source of some degree of chagrin and embarrassment for us that this part of Streamlit

45:22 is a little bit complicated.

45:23 And so we have been working on a bunch of other simpler abstractions that we're going to release

45:32 that will hopefully make this easier to understand.

45:34 Cool.

45:34 Yeah.

45:34 So maybe that's a good place to talk about the future.

45:37 You wrote, you published a roadmap for 2020.

45:39 Yeah.

45:39 Yeah, yeah, yeah, yeah.

45:40 There's two basic things that we're working on.

45:44 So one of them is Streamlit for Teams.

45:47 And so that is the sort of auto deploy version of Streamlit.

45:51 And that lets you basically just check, you know, your apps into GitHub and then deploy

45:56 them instantly.

45:57 And in fact, we are planning to release a version such that if your app is open source on GitHub,

46:04 you get some amount of free hosting, which we're just super, super excited about.

46:09 Yeah.

46:09 So you're basically trying to leverage GitHub's actions and notifications to just do continuous

46:15 deployment.

46:16 All they're going to do is just commit it, right?

46:18 That's right.

46:18 That's right.

46:18 That's right.

46:19 Yeah.

46:19 Yeah.

46:19 We're really excited about that.

46:21 It's, there's a lot of sort of community apps that people put out there for the benefit

46:26 of others.

46:26 And we just feel like this is going to just totally unblock that workflow and make it really

46:31 simple.

46:31 Yeah.

46:31 You're really trying to sneak in some of these like proper CS ideas for non-TSP.

46:37 Yeah.

46:37 Yeah.

46:37 Yeah.

46:38 Yeah.

46:38 You could just do simple scripts, but you're going to have to set up a GitHub repo and you

46:42 have to use service control.

46:42 Oh, you can just like put whatever, but you probably should have a few functions, right?

46:46 Yeah.

46:47 Nudge, nudge.

46:47 It's cool.

46:48 Hey, I love, I love that you say that.

46:50 I think that's, I think that there's a very much element of truth to that.

46:53 But, you know, it goes both ways too.

46:56 We talk to, so, so, so Streamlitz really caught on in the, in like the enterprise, basically

47:01 much, you know, in some ways to our surprise how fast.

47:04 And so we've, we've talked to the data science teams from like 7-Eleven, Caterpillar and all

47:09 these companies.

47:09 And one of the things that we asked them is like, do you guys use source control?

47:13 And often basically the answer is yes, or it's no, but we want to.

47:19 So in a sense, I don't think we view this prescriptively so much as we think this is really where

47:25 things are going anyway.

47:26 And also we want to use the best tools out there and we want to weave them together.

47:33 That's, I think all the, you know, basically if you look through the GitHub, I mean, if

47:37 you look through the Streamlitz source code, it's almost like a roadmap of the coolest tools

47:41 in Python and then out there in the world.

47:43 And so React and all this stuff.

47:45 So we want to weave those together, you know, using the best possible tools in 2020.

47:50 And from our perspective, Git, which is not just GitHub, it's also GitLab.

47:55 And, you know, there's many incarnations is these are amazing, amazing tools that hugely

48:02 make people more productive, actually, once you understand them.

48:05 So being able to embrace them and not reinvent the wheel, but rather be sort of get out of

48:12 the way and let them do their magic is totally part of the Streamlitz.

48:15 Yeah, that's cool.

48:16 Other stuff you got on the roadmap, improved caching, which you just spoke a little bit

48:21 about some plugins, layout.

48:23 You've talked a little bit about that as well.

48:25 Yeah, yeah.

48:26 And then user programmable state is in for multi-page apps.

48:29 All those things sound very useful.

48:31 So I think right now, the experience that people have of Streamlit is this thing is awesome.

48:39 If 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:45 And if that's what you want to do, then Streamlit is just super cool.

48:50 But there are limits to that framework.

48:55 There are in terms of what's possible.

48:57 And 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:09 But 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:24 So 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:37 It's going to go all the way.

49:38 Sure.

49:38 That's a great mission.

49:40 What's the story on authorization, authentication?

49:44 Oh, yeah.

49:44 I would like somebody to interact with this app, but I wanted to remember for them what they did or something like that.

49:50 That is part of the paid product.

49:52 People who want to create it themselves in an open source, purely open source way are welcome to do that.

49:58 But we're going to basically create really simple deployment that gives you that functionality sort of with a couple of clicks.

50:06 So you can say scope it to these people or scope it to my company or use this existing identity provider, SAML or whatnot.

50:14 And 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:22 Sure.

50:23 Okay, cool.

50:23 Well, Adrian, we're getting long on time here, but this has been really fun to talk about.

50:27 There's two quick things I just want to touch on before we move on.

50:31 One 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:41 Yeah.

50:42 How's that going?

50:42 I have to say that it has been a really interesting and instructive experience.

50:48 And 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:00 And we're getting a little stir crazy being at home all day long.

51:05 It's also a silver lining is that we've had to really think about how to build a company that works asynchronously.

51:13 We use Notion all the time, which is like the coolest app of all time.

51:17 We use Streamlitz to coordinate things.

51:19 And it's been an amazing experience.

51:22 And I think we're going to...

51:24 We've actually made a decision to start hiring anywhere in the US now instead of just in San Francisco.

51:29 I'm just so excited about that.

51:32 I mean, we recognize that there's so much talent everywhere.

51:36 And we really just assumed that we all had to be in the same room.

51:42 And I think that these past couple of weeks have kind of shattered that assumption, which is kind of mind-blowing.

51:47 Yeah.

51:47 Boy, it's a tough time in a lot of ways.

51:50 But it's also, I think, shaken up everybody's assumptions about reality for work, for family, for even simple stuff like food.

52:02 Right?

52:02 We used to get takeout a lot and whatnot.

52:04 And we're like, all right, well, we're just going to have to start making more interesting food.

52:07 So I cooked a really good dinner last night.

52:10 Totally.

52:11 But it's like...

52:12 Totally.

52:12 It's just all these different stages or parts of our life are just like, shake, shake, shake.

52:17 Let's see what, you know, shakes out what we really need or what really is the right fit.

52:22 And so it's really cool to hear that you guys are finding a silver lining in it.

52:25 Yeah.

52:25 Yeah.

52:27 One other one is that my son, who's eight, now he has like literally three playdates a day over like Google Hangouts.

52:35 Like he plays like, you know, Fortnite and then he plays Minecraft.

52:39 And it's like, he has a whole new social life that he never had before.

52:44 And he actually told me the other day, he's like, I'm sad.

52:46 I'm going to be sad when COVID is done because I want to have all these playdates over Hangouts with all my friends.

52:51 And I was like, you know what?

52:52 You still can.

52:53 That's never going to go away.

52:55 We just, we just figured out how to do that and you'll have it forever.

52:58 Yeah.

52:58 Yeah.

52:59 That's really cool.

52:59 My daughter's definitely been doing that as well.

53:01 Like she'll sit down at the Xbox with her friend and like prop up, you know, an iPad next to her.

53:06 You see, I'm feeding this character and they're doing the same.

53:09 And you know, it's like, it's, it's pretty neat in that regard.

53:13 The 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:22 is the Lo and Behold documentary by Van Rietzog.

53:26 Yeah.

53:26 For 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:34 Yeah.

53:35 What was your involvement there?

53:36 That sounds fun.

53:37 I was interviewed as one of the sort of like internet pioneers because of my work with Foldit.

53:43 I was probably like the least famous person by far that day because it was like Elon Musk and all these people.

53:50 So I'm sure that they, when they watched it, they were like, who's this, you know, who's this guy?

53:55 But it was because I folded.

53:56 And 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:05 And 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:14 How cool.

54:17 Stuff like that.

54:17 So I was like, it was really cool meeting him.

54:19 And obviously it's a legendary filmmaker.

54:21 Yeah.

54:22 Oh, how cool.

54:23 I just, if you were looking to watch something interesting, lo and behold, it's a fantastic option there.

54:28 Yeah.

54:29 All right.

54:29 Well, final two questions before I let you out of here.

54:31 If you're going to work on Streamlit or other Python code, what editor do you use?

54:37 Oh, VS Code all the way.

54:39 All right.

54:39 Right on.

54:40 Although, 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:48 Oh, yeah.

54:48 And 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:56 But on the iPad, there is no VS Code.

54:58 So I would love if there were VS Code and please someone make that happen.

55:03 I'll give you two things that you can play with that I know about.

55:06 I'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:13 Yeah.

55:13 But one is Carnet, C-A-R-N-E-T-S.

55:17 Oh.

55:18 It'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:28 That's awesome.

55:29 It's pretty cool.

55:31 I think it might even be open source.

55:32 I'm not sure.

55:33 And then you can set up Visual Studio Code online.

55:38 So Visual Studio online.

55:39 And then run that.

55:41 I think you can run that in your web browser and basically get VS Code.

55:45 I've been trying to do that and I cannot get it to work.

55:48 Is it working?

55:48 Yeah.

55:49 I can.

55:50 It doesn't.

55:51 The iPad browser just doesn't quite like have it.

55:56 It's missing a couple of things that.

55:58 So I've been, that's been my, I've been trying to do that.

56:00 And maybe I'm getting something wrong.

56:02 So anyway.

56:03 Maybe.

56:03 I 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:13 Totally.

56:13 That's just bizarre to me.

56:14 So anyway.

56:15 Yeah.

56:16 Yeah.

56:16 Cool.

56:16 Cool.

56:17 All right.

56:17 And then notable PyPI package.

56:20 Something, some Python package that you're like, maybe it's not the most popular, but like, wow, people should know about this.

56:25 And 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:33 This is.

56:34 I think it's semi-famous, but I would really get tell people that I want to shout out to Altair.

56:39 Basically, you know, a lot of people know Matplotlib.

56:42 A lot of people know Plotly.

56:43 A lot of people know Bokeh.

56:45 I think Altair is a little less famous.

56:47 The short story is they took D3, which is this legendary thing.

56:51 They simplified it into a declarative JSON language called Vega, but that was way too complicated.

56:57 So they simplified that into an even simpler language called Vega Lite.

57:00 And then someone created, at Google, created Python bindings for that, and it's called Altair.

57:05 And this thing, it's its own philosophy, man.

57:09 But 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:17 And I just think Altair is great.

57:19 Awesome.

57:19 Yeah, I've definitely heard good things from Altair.

57:21 Yeah.

57:22 About Altair.

57:22 So a good recommendation.

57:23 All right, Adrian.

57:25 Final call to action.

57:26 People are excited about Streamlit.

57:27 Want to check it out.

57:28 Do more with it.

57:29 What do you say?

57:29 Go for it.

57:30 Super fun.

57:31 Streamlit.io or just pip install Streamlit.

57:34 And then type Streamlit that hello on the command line and you'll be playing with interactive stuff in minutes.

57:40 Well, thanks for being on the show.

57:42 It's been really great to talk to you about your project.

57:43 Yeah.

57:44 Thanks so much, Mike.

57:45 I really appreciate it.

57:46 You're welcome.

57:46 Bye-bye.

57:46 All right.

57:47 Take care.

57:47 Bye.

57:47 This has been another episode of Talk Python to Me.

57:51 Our guest on this episode is Adrian Troiel.

57:54 And it's been brought to you by Linode and Reuven Lerner's Ace Python Interviews course.

57:58 Start your next Python project on Linode's state-of-the-art cloud service.

58:03 Just visit talkpython.fm/Linode.

58:06 L-I-N-O-D-E.

58:07 You'll automatically get a $20 credit when you create a new account.

58:11 Ace that Python interview.

58:13 Let Reuven Lerner's course help you get that next Python job.

58:17 Just visit talkpython.fm/ace to take his free course.

58:22 Want to level up your Python?

58:24 If you're just getting started, try my Python Jumpstart by Building 10 Apps course.

58:29 Or 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:37 And of course, if you're interested in more than one of these, be sure to check out our Everything Bundle.

58:42 It's like a subscription that never expires.

58:44 Be sure to subscribe to the show.

58:46 Open your favorite podcatcher and search for Python.

58:48 We should be right at the top.

58:49 You 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:59 This is your host, Michael Kennedy.

59:00 Thanks so much for listening.

59:02 I really appreciate it.

59:03 Now get out there and write some Python code.

59:05 I really appreciate it.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon