import tickerinside as ti # Reads both funds' files and measures the overlap as the site does c = ti.compare("VOO", "QQQ") # Each fund's holdings come with the date of its own issuer's file for ticker, day in c.holdings_as_of.items(): print(ticker, "holdings_as_of", day) # by_weight: for every ticker both funds hold, the smaller weight, added up. # companies_in_both is the field a /compare/ file calls overlap.n_shared ov = c.data["overlap"] print(f"overlap by weight {ov['by_weight']}%, " f"{ov['companies_in_both']} companies in both") # The line to print under the figure print(c.cite)