Closed TryThis closed 8 months ago
Hi,
the function ranking_place returns the value / points of the ranking but not the ranking place.
if you would add /change the following properties
@property def ranking_place(self) -> typing.Optional[int]: return self._get_wikifolio_key_figure("rankingPlace") @property def ranking_points(self) -> typing.Optional[float]: return self._get_wikifolio_key_figure(1, 0)
and change the function towards
def _get_wikifolio_key_figure(self, metric, submetric = 0, section = "kpis") -> typing.Optional[float]: try: key_figures = self.rawData["props"]["pageProps"]["data"]["keyFigures"] if metric == "totalInvestments" or metric == "tradingVolume" or metric == "liquidationFigure": return key_figures[metric]["ranking"]["value"] elif metric == "rankingPlace": return key_figures["kpis"][1]["rankings"][0]["ranking"]["place"] else: return key_figures[section][metric]["rankings"][submetric]["ranking"]["value"] except Exception as e: print("Error at _get_wikifolio_key_figure -> Open a issue on GitHub: " + str(e)) return None
you could deliver both points and the right ranking place.
implemented, thanks for your code :)
You're welcome. Your library will save me a lot of time 😀
Hi,
the function ranking_place returns the value / points of the ranking but not the ranking place.
if you would add /change the following properties
and change the function towards
you could deliver both points and the right ranking place.