Stock KPI analysis tool using matplotlib
Works with Linux, macOS, and Windows. Requires Python 3.10 or later.
git clone https://github.com/Adobe-Android/stock-kpi-plot.git
Install virtualenv if it is not already installed or use the Python 3.5+ venv.
python -m pipx install virtualenv
If you do not have pipx installed, either install it with pip (command below) or first install pipx.
python -m pip install --user virtualenv
Go to the project directory.
cd stock-kpi-plot
Next, we can actually create our virtual environment inside of our newly cloned directory.
virtualenv env
Activate the virtual environment using the appropriate files for our environment. I'll include commands for the most common scenarios below. More information can be found here
Bash (macOS, Linux, or other Unix)
source bin/activate
PowerShell (Windows)
.\env\Scripts\activate.ps1
Command Prompt (Windows)
.\env\Scripts\activate.bat
python -m pip install -r requirements.txt
python -m avgo_grouped_barchart_with_labels_from_excel
python -m mrvl_grouped_barchart_with_labels_from_excel
As you can see, this style of bar chart has issues when we try to display more data. In this case, I chose to switch to a stacked bar chart to resolve this issue.
python -m mrvl_stacked_barchart_with_labels_from_excel
The program expects to read from an Excel file in the same directory as the Python script. The expected naming scheme is {ticker}.xlsx.
-
https://realpython.com/python-virtual-environments-a-primer/
-
https://www.freecodecamp.org/news/how-to-setup-virtual-environments-in-python/
python -m pip install --user -U pipx
python -m pipx ensurepath
If you are having trouble on Windows specifically, I'd suggest you clean out the following directories. I've found these issues to be common when you've maintained a Windows install long enough to have downloaded at least a few Python versions over time, even if you only have the latest installed now.
C:\Users\tngam\.local - delete bin and pipx folders
C:\Users\tngam\AppData\Roaming\Python - delete all folders
If you are on macOS or Linux, you probably aren't having these sorts of problems, but feel free to open an issue.