These are value investing related Python scripts I wrote to search and filter stock-related metrics I like.
upendra-screen
- My six-step screen that programmatically determines ratios mentioned in Professor Kenneth Jeffrey Marshall's book Good Stocks Cheapupendra-simple-dcf
- Calculates present value of future cash flow using the DCF model. Inputs include discount rate, cash flow growth in best, worst and normal scenarios, margin of safety and more.fprep-basic
- Get started by making a basic Financial Modeling Prep call, view the output and extract a value you likefprep-roce_best
- Calculations for getting Return on Capital Employed (ROCE) of any company that meets a threshold along with other metrics like average ROCE over the years and my own magic number to compute ROCE growth, with output sorted in descending orderfprep-52week-low
- Identifies companies that are close to their 52 week lows, meeting a threshold, with output sorted from closest to lowfprep-dcf-discount
- Identifies companies that are trading at a discount compared to their DCF-based intrinsic value, with output sorted in descending orderlist-of-companies
- Gets a list of companies that are available with Financial Modeling Prep
buy_or_hold
- This Python script analyzes S&P 500 data from 1999 to early 2020 (supplied as a CSV file) and figures out if buying after a threshold (%) drop in the markets is better or if dollar cost averaging is better.
- Scraping Yahoo Finance with LXML (I have a working, published Android app on this if you're interested: https://play.google.com/store/apps/details?id=com.upen.rocecalculator)
- Scraping Yahoo Finance with Beautiful Soup
- Clone this project, then run the Python scripts using your IDE or the
python
command.
- Python
- SQLite3
- Beautiful Soup
- LXML
- Data from Financial Modeling Prep and Yahoo Finance