Don't tell anyone what you will see in this video, because this might be the coolest Python tool you
have seen to date.
It is very new and only a few know about it, and that is the stream late Python framework.
And it is not just a framework, it is a complete free service which allows you to create molds or interactive
Python web apps and also data visualization dashboards and deploy them instantly.
The framework is tied to a cloud service, so your apps are public right away.
So in this video, I'll show you how to create apps and data dashboards with stream let.
That is the official web page of stream leads.
And so you don't need to have and you can't.
You just go straight away and create a Python script.
So I'm using Ripple, as you know, already, you can do this on your favorite I.D. on your local computer,
if you like.
Create.
Web apps
and data dashboards.
So I'll introduce you to stream lead by first creating a simple Web app, which is basically just a
website which has some text, and then we add pandas data frame tables to that web app and also graphs.
So you need to import swim, let's.
It's a good practice to name vets as T, because that's what you will see among the documentation of
stream leads and what are the programs we will use in the insurance community.
So it's good to be in line with that style.
Then you can refer to stream leads so as to in our case and said a title first for your website.
Our first saw him lit up.
And to add perhaps a sub header.
Introducing stream lit in Ultimate.
Everything with Python.
So we have a totally subhead there, and let's add some text, such as this is our first web app.
And if you want this to be multiple multi-line texts, you want to use triple quotes.
Their triple quotes are there that allows you to add more lines such as enjoyed.
Yeah, like that's.
And that is enough for a simple website that let's run this now to around this, you don't just run
with the run button.
What you need to do is one way to run this is to go to the shell and to write.
Stream, let's run Maine, though, it's p y, but don't do this.
A better way to run is by creating an empty dodger apple lit file so that Ripple I.T. create that file
in here.
So that's an empty file.
If you are running this locally, then you should use these commands in Ripple.
You create that file and do wrong equals to double quotes open and close, and you put that command
there.
So stream, stream, let run mean that's p y.
So our file where the code is is called Maine.
That's why that's why we have that.
So when we were on the project now with this button, this button will execute.
That's commands.
Normally that button executes the command.
Python main, that's why, but when you have vets, that's a reptile, it's file in here that the bots
and reads are the content of this file and runs the commands inside those quotes.
So we're ready to run run stream lights will be installed now, so this should take a while.
Once the installation is complete, then you should get this prompt here.
You don't have to answer an email.
You can just press.
Enter your.
And here is the Web.
There's a title that's a subheading, and that's the contents.
Now let's take a look at the address of the.
This is a local IP address that means you cannot access the app from the outside of the network, so
not anyone can view your app just yet a view in some ripples.
You will get a public URL if you don't get a public URL, then you can deploy your app, and I'll show
you how now to deploy your app so that everyone can visit your web app.
You need to have GitHub, so you need to have a GitHub account and you need to be looked in in that
gets up accounts in your browser.
So, for example, I'm logged in in my GitHub account here.
And then what you need to do is you have to go to the version control section or for.
If you are locally on your computer, if you're using Pi Charm, Visual Studio code, etc, you can
still do this.
So you have to upload your code into GitHub.
So do that if you are using a local I.D. If you are Apple, you have to go here as I'm doing creates
a for.
No, if you are not still connected with your GitHub account, Ripple will ask you through a window
here to connect to your robot to your target, HarperCollins.
Make sure that you allow pop up windows for your browser in your browser for this page.
Otherwise, a window might be hiding here, which will ask you to login to GitHub so you may have a
bar or a notification here, so be careful of that.
In my case, I can just press connect to GitHub because I have already clicked on that pop up window
that I got previously.
So here you create a GitHub repository.
Where do you want to upload your code to the GitHub servers?
The visibility of the repository should be public, otherwise this will not work.
Stream leads will not be able to get to your repository.
Press public and then create a repository.
Right then, if you click here.
This should take you to that GitHub repository.
So that's all codes mean that if you why is the code we have been writing in this video?
And that's the home page of the repository.
So here now, the next step is to go to.
Shared stream leads, dots, i o.
And then you want to connect to continue with GitHub.
And you want to offer ice stream leads to connect with your kids, Harper Collins.
The community version should be fine, so continue.
You have to fill in these dots and press and continue.
Then this page should show up, so you want to press on that dropdown list and go to from existing Ripple,
then go here to paste GitHub URL and you should now go to your repository and click on Main.
That's why.
And then copy the URL that you see in your browser, so copy that.
And paste it in here.
And press on deploying.
And wait a while until the deployment is completed.
That's the app, that's Euro, so that's where you can copy it, and you can close this page, perhaps
open a private browser.
Paste, that's your over and you'll see that you can access the app so it's visible for everyone.
All right.
Let's go back to our development environment now and see how we can add a graph to create a graph.
We need some data.
And Panda's basic goods at library to work with Delta.
So let's create, for example, some dots of first using a Python dictionary and that creates a pandas
dataframe out of a dictionary.
So let's suppose we have serious one of this string.
It has a least of one three four five seven.
So one, two, three, four or five items in the list a comma.
Series two.
It has a list of 10, 30, 40, 100, 250.
So five items, they're five items in there.
So that's the key value pairs of keys and value.
That's how a dictionary is made of.
And then we create a data frame out of that.
Let's say the f is equal to pandas.
That's data from the different class, which can get the data.
As inputs, so this will create a data frame out of the data dictionary.
Now I can print this data frame out here in the command line for you to see, but we don't have to do
that.
So when we can just say as T dot right and pass the f there so that data frame you were right, it's
easier now if you go to the local app, in your local browser, in the local IP address and you see
rerun.
You should see the dataframe displayed there in the Web.
But if you go to the IP address to the public URL of your app, you will not see that update.
To update this, you want to first upload the changes to GitHub.
So once you do the change, go to the version control section adds a commit message here.
So at table or something like that?
Just a note to know what you're doing and commit a push to push the data to the GitHub account.
Right?
That's completed.
The commits is completed.
If you go to Strimling, no surprise, you have the table already there, so the public URL is updated
with the latest changes.
So there are automatic updates from your GitHub account.
Let's add the graph now that we have the data frame for a line graph, you have the line chart methods
past the ever and you should get this button again automatically on the browser.
So we run.
And locally, we see the graph in here.
So we have one line for the first series and the second life for the second series.
The tremlett is not.
The public you are, of course, is not yet updated because we need to do a commit and the push adds
Graf as a commit message, commit and push.
Go to the public sites and voila, we have the graph there.
You can also add other types of graph, such as a city dot area chart the F.
Rerun.
And so we should see another graph here.
That's one in there.
You could also add widgets to your Web app.
For example, let's say my slider is equal to the slider.
Let's give this the label Celsius.
You'll see in just a bit of why I named this Celsius.
Once you have a slider, then you want to write.
You want to add basically that slider to the Web up, so writes my slider, lets say in focus tonight.
Is.
Mice line two times nine, divided by five.
Plus, 32.
So that is a formula that's converts Celsius to foreign nights.
You will understand everything in just a bit.
Yeah, well, that's it.
Let's run this app.
And let's scroll down.
There's a slider.
So zero Celsius degree is 30 to Fahrenheit.
How about.
21.
It's sixty nine point eight.
Yeah.
So there you have an app that gets input from the user in a very interactive, fun way.
And it returns the outputs instantly.
In here, let me commit this as well at slider commits and push.
And there we go.
That's a complete F..
That's concludes this video.
I hope you found this interesting, and it's just amazing how much you can do with just 20 lines of
Python codes.
I hope this worked for you, and I'll talk to you in the next videos.
See?