The NSE website has PE (Price to Earnings), PB (Price to Book) and Dividend Yields of indices going back a decade. Even though their methodology of calculating these has its drawbacks, they are consistently applied to all the indices. This makes an apples-to-apples comparison possible.
Here are the historical PE and PB ratios of the NIFTY 50 and NIFTY MIDCAP 50 indices:
In the next part, we will explore if these can be used to time or switch between large-caps and mid-caps.
Code and charts on github.