Morningstar Quantitative Ratings for Stocks are generated using an algorithm that compares companies that are not under analyst coverage to peer companies that do receive analyst-driven ratings.
If you’re looking for a place to start, W3Schools has a Python tutorial that’s pretty straightforward. It breaks things down ...