The stock monitoring project was realized to simulate the evolution of a fictious stocks portfolio.
The real idea behind was to find an interesting topic which could help me to learn Dash
and to reinforce my Pandas knowledge. Indeed, It's one thing to read a technical documentation but it becomes more challenging when you start practicing it :-).
It's not a big deal to monitor stocks, especially using the pyfinance package, and I really encourage you to check the documentation of that package.
In my case, I could not use it 'as is' in the DASH graphs because I wanted to perform 'on the fly' calculation on the values; so I had to manipulate the informations in Pandas first...
DASH is easy to use, you design a layout with 'components' and this allows you to describe the look and feel of the app.
Then you define in a callback, how do you want to create the interaction between the elements (ie: a radio button interact with a graph).
The DASH magic is that the components are accessible in Python and they generate behind the scenes HTML tags & Javascript codes.
The rest of the code is pure Python and in my case I used the Pandas library in order to make data transformation: Dataframe filters, calculations, concatenations, columns selections, loop iterations....
Finally, in order to put that code in 'production', I encapsulated it into a Docker container.
Now the app is running on my NAS, like this, it's running even if my laptop is switched off, to access it via mobile phone.
At the end I learned/revied lot of things:
In this video the project is explained and couple of Python codes are presented
If you want to get this app on your own machine?That's super easy :
By continuing to browse the site you are agreeing to our use of cookies. Review our cookies information for more details.