 All right, welcome back. So now we have Stephen with us. And Stephen's going to be talking about Streamlit. It is one of the fastest way to build data applications and has been doing rounds about in both the machine learning as well as the software engineering world. And I'm particularly really, really psyched about this session and about Stephen too. A little bit about Stephen, he is a CS finalist and he kind of does work between software engineering and data science, so majorly around machine learning engineering stuff. And he's mostly focused around machine learning research and around product development around it. So Stephen, great to have you over here. And yeah, looking forward to your talk. Yeah, and everyone, I'm so excited to be here. It's an AGO Python 2021. This is my first work at AGO Python. It's just so warm to be in here. So I'll be speaking about Streamlit, the fastest way to build data apps. And of course, my name is Stephen Kolaoli. In this talk, we'll go through the problem statement, why we need Streamlit in the first place. Secondly, we're talking about Streamlit. I mean, what Streamlit is all about. The next talk we'll be talking about will be installing Streamlit. We'll get to play around with some demo. After hours, we'll move on to building a simple data app with Streamlit. And I'll show you all the building blocks of a simple Streamlit app. And then we'll be having a sneak peek at the different use cases. What people have been using Streamlit for. Finally, I would go to the console, Streamlit. Just reconstruct everything that doesn't make a Streamlit the perfect solution to everywhere that program right now. So once again, this is my profile. I'm Stephen Kolaoli at Houndo by now. I'm a machine learning engineer. I do most different things these days. I'm also a computer scientist, undergrad, going through my final year. And also, my skill set is somewhere in the intersection between software engineering and machine learning. Other four parts, I've been a live-up with the fans. I was a kid. I used to make up almost everything. I used it for web development for machine learning, for data science, analytics, and all. I'll just kind of talk about that last part. So moving on, what's the problem statement? Oh, I'm not floating. OK, so if you're familiar with the normal process of building data apps, this is the usual process. There's the data processing step. Of course, you carry a lot of analysis out in the notebook. The thing is, notebooks are built for experimentation, for analysis. Most times, they are not codes that you can share easily with people. And let's say you want to communicate your findings to all that people, or maybe to your colleagues in your organization. So that means you copy the relevant work. You could always claim the notebooks and send it to them. And you could also copy the relevant functions in the five scripts. And let's say you want to share it to a large number of people, or maybe you want to put a demo. Then that means you need to create an app using Flux. And if you're creating an app using Flux, Flux is just for the back end. You also need to worry about HTML, CSS, JavaScript, at the very least for the front end functionality of the web app. So let's say you're in this sort of a large organization and you have a dedicated software engineering thing. And let's say you're pushing your code into production. So you could outline all the requirements on the UI-UX design, right? And you hand it over to the engineering thing. And of course, they could create a performance app based on your requirements. And then the need will probably tell you, hey, man, we have lots of projects we're monitoring. So we'll only be able to carry out topics on your app, let's say once in a few months or so. Now that's the share process. Now that leads us to our pain points. The pain points are number one, the software engineering thing. When you depend on them, because they are handling lots of projects, that means that it takes up a bunch of your time. I mean, the communication on-screen flow is always difficult and messy to maintain. And of course, you can't just create new features and updates on the web, because the software development team have lots of projects they're monitoring, right? And most times, we could create this app ourselves, right? But the number one issue is some of us, if you're like me, I can't recognize the purple color from the blue color. So lots of us saw how to design and we rather write codes. I mean, we rather write codes for analysis or for straight engineering, write code for aesthetics. Yeah. And also, creating web apps is surely consuming a huge amount of our time. And you also need to consider the learning code. I mean, you need to know how to create applications with class. And then you need to bother with the front-end frameworks. And also, I mentioned this earlier, some of us would prefer to use our code to generate insights and build models, rather than use this code to provide users with aesthetic experience. So that is also this million-dollar question. What if it could build apps as easily as writing Python script, right? Yeah. And that is us to stream it. What's streamlit? Streamlit is all about building apps as easily as writing Python script. Let's say you have a Python script for a year, and then you split code in a few API calls into your functions. And you move over a year, and you can show off your beautiful performance or web app. It's that easy. Yeah. And we'll go through demo very soon. And one other advantage of Streamlit is that it covers most of you guys using data app. If you build visualizations in data app, if you've been building web apps before, then you're familiar that you need to consider the layout, right? You need to decide maybe you want to play the particular chat by the side, or you want to place it. You want it to take off a rich space on your web app. You might want slide ads. You might want check boxes. You might want markdowns, right? And all these things, they usually take up a huge amount of lines of code, right? But in Streamlit, if you just implement all these with a single line of code, if you do something like import Streamlit as ST, then you could have ST.hidebar, ST.selectbox, ST.radio, and so on and so forth. And I think that's very cool. One other story is, Streamlit supports multiple interactive or visualization libraries. If they're used to creating libraries, right, then if they're used to creating visualizations, then them is, you know, Kotli, you know, author, you know, bookcase, you know, must Kotli, must Siebel. And Streamlit provides support for all these libraries. I mean, there's a project I'm working on currently using Streamlit as for the dashboard pattern. I think I'm using Kotli for the visualizations. And it supports lots of visualization libraries out of the course. And you don't use to get this, you know, that often. Yeah, so let's move on to installing Streamlit complete. To install Streamlit, all you need to do is to keep install Streamlit. And then you try out Streamlit alone, yeah? So I'm going to try that out in my command prompt. So I'm going to do this because I've already installed Streamlit, OK, let's take the version. Oh, yeah, so 0.84. That's the version of Streamlit. If you don't have Streamlit installed already, you won't be able to do that, right? So I'm going to try out Streamlit now. Oh, so Streamlit, hello, sorry about that. All right, so you can see the localhost 85.01 on the Streamlit store. Oh, yeah, so you can see the web app over here. And you can select, you know, different kind of demo. I'm going to select this. And what do we have here? You can see a bit of animation, you know. I think this is quite cool. I think this is quite cool. There is a place where we could check for the code. I guess it's still on, so you can see that's it. You can check out the plotting demo for sure. And then you can see the animation. There's a little animation combined with the closing. All right, so look at the code over here. And I think we did that in less than 20 lines of code. And I think that's quite cool. Yeah, so moving on, now that we've installed Streamlit, then we could, you know, clear out with the demo. Now, this is a single L over the script. All you have to do is import Streamlit as SD. And then do something like this, SD.ly L over. And you could go over to your command forms and do the Streamlit on L over the script, right? That's quite simple. I could do that over here. I think I hope I'm going to fire over here. All right, so, but I'm not going to run this. Let's play with a proper, you know, a proper demo. And look at this. A sister of mine was learning statistics, actually, of the different distributions and everything. And, you know, it would seem a bit abstract if you're not from a math background here. And so I feel that, you know, it would be more fun if she could get to play around with what she's learning, right? That was the inspiration behind this little demo app, right? So you can see, I imported Streamlit as SD and, of course, NumPy as empty. NumPy is the maker from put in library in Python. Oh, OK, yeah. So we could have a SD.title, right? And you could see distribution tester. So we're going to have a big title called Distribution Tester. You could see SD.write, right? We have the keys, which is, you know, a list containing normal and uniform. And of course, you could, there's this select box. SD, the select box means we're going to have a select box. And the select box is going to contain normal and uniform. So if the user selects normal, you're going to have a randomly generated number between the range of 0 to 1,000. But if the user selects uniform, then you're going to have at least an array of numbers of 1,000 numbers generated between the range of 0 to 100, right? And you're going to have a line chart plotting the norms, which is the result of whatever the user selects. So I'm going to go over to my browser. I'm going to try Streamlit on this folder. OK, so I'm going to try. So it's going to go from 0 to 1,000. All right, so you can see that. You can see the type too. You can see the SD.write. You can see the select box, right? And normal was selected as the default. So if I change this to uniform, you can see that the chart is different. And I think we did this in less than, there are 16 lines of code in spaces and everything, more like 12 lines of code. And I think that's amazing. Who would have thought that this in class, in that amount of time? All right, so moving forward. OK, yes, so moving forward. So would that be the user some use cases of Streamlit, right? And then, yeah, so the first one I'll show is this. Udacity self-driving car for 2D cassette. This was created by the Streamlit team. You can go on a complete neural net, right? In real time, from within that app. I'll show you the link to this link down. Yeah, so let me show you some couple of orders. OK, yeah, so this was, this is the demo I was talking about, you can check it out. Yes, another link. This was created by a friend of mine, Muya Sola. And yes, another link. This is a link to the gallery, to Streamlit Gallery. The Streamlit Gallery contains apps that have been built by other Streamlit developers across the globe. And you can see lots of interesting use cases over here. There's this New York City Uber ride sharing data. And you can see lots of stuff, lots of stuff. Yeah, so and of course, it cost, of course, many fields. You see computer vision, you see computer vision and you can see the Umapus estimator. You can see the New York City transfer and lots of other use cases of Streamlit, right? So you can check, yes, the demo of the self-driving car. So yes, the link to the GitHub where you see it. So you could check this out. You could check this out later, right? Yeah. So finally, this was the app that was built by this friend of mine. Of course, you can see lots of, you can see it's live AI. You can see, you can see, you can select the kind of house, the kind of location you want. This was built for major cities in Lagos State. Lagos is in Nigeria, right? So pick any city. Let's say you pick Lecky, for example. You could choose the number of bathroom, the number of bedrooms, the number of toilets. You could choose all these options and you could question evaluate from stone. And you're going to have an estimation of the price of that house. Over here, I think we have 2.3 million Naira as the house will be selected, preferences. All right. So moving on. Moving on. So let's go to the reasons why Streamlit might not be that awesome. And I think the number one is the convenience specific tradeoff. The further, Streamlit abstract out most of these UI decision-making for you. Even though it's a point of strength. I mean, the source of strength is also a weakness point, right? Because Streamlit has abstracted out all these, all these UI decision-making for you. So that means that you don't get to have much take in the kind of UI design style you want. I mean, you can just wake up and want to have a chart embedded in another chart. You might not be able to do something like that with Streamlit. And actually, I feel this has been greatly improved on because I remember the last, the first time I gave it for Streamlit, which was about a year ago. You can't place a, you couldn't place a chart side by side, two charts or three charts side by side. But right now you could do that to play up to five, six charts as much as you want, you know, side by side. Yeah, so another is the size of data input. And I remember the first time I spoke about this, it was 50 MB. You can't upload files back and down of 15 megabytes. But right now you can, you can upload files up to 200 megabytes and Streamlit is very flexible with all the kind of files that you can upload and the kind of checks that you can put in place. Also, limited support for videos and animations and as I was saying, all these calls have been greatly improved on. Yeah, even though the support is still limited but it wasn't as limited as before. You can't build apps with, you know, functionalities, with complex functionalities. For example, you know, you are having a newsletter subscription, you are having a user to user interaction, right? And let's say user authentication, but right now you could actually have a Streamlit app with user authentication. I think lots of work are going on on Streamlit and I think the future is quite, you know, right for Streamlit. Yeah, and I was also saying even still, Streamlit is still simply not used for every Python programmer out there. And it's superb if you want an iterative data app very quickly. But let's say what you want is an app with, you know, with a chatbot, with a, you know, Streamlit supports pagination, but if you want an app with lots of complex functions, then you might better off with Flux or Django. Yeah, so finally, you know, these are the two kits that you're going to need, you know, as a Streamlit developer compared to a Flux developer. If a Flux developer, you need to know Flux and you need to know other JavaScript frameworks, other front-end libraries, for example, you need to know HTML, CSS, JSON and the very least. But if you're a Streamlit developer, you need to know Streamlit. And let's say if you want to containerize your web applications, then you can use stuff for that. All right, I've just said that, thank you very much for listening to this stuff. And I hope you're able to gain a team or two. And if you're free to say hi to me on LinkedIn, and of course you can connect with me on Twitter also. So thank you. Perfect, I'm glad you were able to, you know, finish your talk. Yeah, bad time to miss the notification of low battery though. So we can probably take one question and people who have questions later on can probably reach out to you in the breakout session. So the question is, can one password protect access to Streamlit-generated pages? And can they collect information in a password protected area if they have more than one? Oh, yeah, definitely, definitely. I think some of the first use cases of Streamlit whereas demo apps, you know, I mean, it's not something that you could push into production. But these days people are quitting production, production scale up more and more with Streamlit. Yes, this is something, I think I still saw it on Streamlit discussion, discussion four recently. I mean, somebody was asking a question related to this. Yes, you could have a password would take assets to Streamlit-generated pages. Though you might need to be careful with the kind of assets that you give out to users. I mean, if your web app is containing sensitive information, so yes, you can collect passwords, you can provide access to password and collect password and vice versa. Perfect, yeah. Good to know that. I hope that answers the person who asked this question. With that, thank you so much again for your talk and I hope people find you in the breakout rooms for parrot for the questions. Oh, all right. Thank you very much for having me.