Building a Python Fintech App in 200 Lines of Code — Introducing Betalyzer
Betalyzer is a fully function web app that uses some key Python libraries to create a financial technology application in 200 lines of code (ok, ok, it is more like 226 as of this writing). Betalyzer makes use of the modern financial data and web stack including pandas, Flask, Quandl, and Jupyter.
NOTE: It is meant more as a tutorial than a usable web application, and you’ll find the data stale if you try to use it (though, if you wish, you can update the data once you clone it).
The Web App
Betalyzer calculates the betas of hundreds of stocks listed on NASDAQ and displays the results in an HTML frontend.
It only consists of two page types. The main page:
And the ticker page:
It even has a REST API and an Excel Add In:
The Tech Stack
The code is available on GitHub (feel free to fork the repo or submit pull requests). I’ve tried to document it as well as possible in this readme, and won’t get into the details here. The code is short and sweet —just a couple hundred lines of Python and a couple hundred lines of HTML!
The main language I use is Python, especially the PyData stack and pandas. Pandas is a powerful yet easy to use data analysis library that was born at a top quantitative hedge fund. I also use Bokeh, a fairly new charting library that plays well with both pandas as well as modern web front ends.
The web layer consists of Flask, a Python web “micro-framework” that allows us to get going with minimal code, as well as jQuery, CSS and HTML for the front end. Bootstrap and Datatables add a bit of flair.
Finance is changing, and fast. This tutorial shows that using lightweight and nimble technologies, laying the infrastructure and building financial apps is quick and easy, yet powerful.
Reach out on LinkedIn if you want to get in touch.