Video Demo
This is a command-line interface (CLI) tool for analyzing financial statements and performing discounted cash flow (DCF) and comparables analysis. The tool uses the Financial Modelling Prep API, which requires an API key. The Github repository with source code and release binaries can be found here
- Python 3.10 installation
- Account with Financial Modeling Prep
- Bash or Zsh terminal. Windows users are highly advised to use WSL
- Sqlite Browser to view and manipulate the data in the database
- Homebrew and Git to develop the application
Note: use python3
,pip3
on MacOS and python
, pip
on Windows
- Clone the repository or download the release binary
git clone https://github.com/larry-lime/pyfinny.git cd pyfinny
- Create and start python virtual environment
python3 -m venv venv
- Activate Python virtual environment
source venv/bin/activate
- Install requirements
python3 setup.py develop
Run pyfin
in your terminal to begin using the application
Before you begin analyzing, you must run the setup command to provide your Financial Modelling Prep API Key and create the necessary database.
pyfin setup
To open an Excel file, use the open command and provide the name of the file without the file extension. The -d
or --resource_dir
option can be used to specify the directory where the Excel file is located. If not provided, the default directory is resources
.
pyfin open filename [-d|--resource_dir]
To open the DCF template, run the following command:
pyfin open dcf
To open the comparables analysis template, run the following command:
pyfin open compare
To load company financial statements, use the load command. The -f
or --filename
option can be used to specify the file containing the tickers of the companies to load. If not provided, the default file is load.txt
.
pyfin load [-f|--filename]
To load the financial statements of the companies in load.txt
, run the following command:
pyfin load
To load the financial statements of the companies in dcf.txt
, run the following command:
pyfin load -f dcf.txt
To print data from the database, use the data command. The -t
or --table
option can be used to specify the table to print. If this option is not provided, the user will be prompted to choose which tables to print.
pyfin data [-t|--table]
To start the interactive prompt, run the following command:
pyfin data
To print the data from the income_statement
table, run the following command:
pyfin data -t income_statement
To print the tickers in a file, use the tickers command. The -f
or --filename
option can be used to specify the file containing the tickers. If not provided, the default file is load.txt
. The -d
or --ticker_dir
option can be used to specify the directory where the ticker files are located. If not provided, the default directory is tickers
.
pyfin tickers [-f|--filename] [-d|--ticker_dir]
To print the tickers in load.txt
, run the following command:
pyfin tickers
To print the tickers in dcf.txt
, run the following command:
pyfin tickers -f dcf.txt
To perform a discounted cash flow analysis, use the dcf command. The -f
or --filename
option can be used to specify the file containing the tickers to use for the analysis. If not provided, the default file is load.txt
. The -t
or --template_name
option can be used to specify the name of the Excel sheet containing the DCF template. If not provided, the default sheet name is Template
. The -n
or --dcf_analysis_name
option can be used to specify the name of the Excel file to write the DCF analysis to. If not provided, the default file name is dcf.xlsx
.
pyfin dcf [-f|--filename] [-t|--template_name] [-n|--dcf_analysis_name]
To perform a DCF analysis using the companies in dcf.txt
, run the following command:
pyfin dcf
To perform a comparables analysis, use the comparables command. The -n
or --comparables_analysis_name
option can be used to specify the name of the Excel file to write the comparables analysis to. If not provided, the default file name is compare.xlsx
. The -f
or --filename
option can be used to specify the file containing the tickers to use for the analysis. If not provided, the default file is load.txt
.
pyfin compare [-n|--comparables_analysis_name] [-f|--filename]
To perform a comparables analysis using the companies in compare.txt
, run the following command:
pyfin compare