示例#1
0
    def call_info(self, other_args):
        """Process info command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="info",
            description="""
                    Shows basic information about loaded coin like:
                    Name, Symbol, Description, Market Cap, Public Interest, Supply, and Price related metrics
                    """,
        )

        ns_parser = parse_known_args_and_warn(parser, other_args,
                                              EXPORT_ONLY_RAW_DATA_ALLOWED)

        if ns_parser:
            pycoingecko_view.display_info(symbol=self.coin_map_df["CoinGecko"],
                                          export=ns_parser.export)
    def call_info(self, other_args):
        """Process info command"""
        if self.current_coin:
            parser = argparse.ArgumentParser(
                add_help=False,
                formatter_class=argparse.ArgumentDefaultsHelpFormatter,
                prog="info",
                description="""
                     Shows basic information about loaded coin like:
                     Name, Symbol, Description, Market Cap, Public Interest, Supply, and Price related metrics
                     """,
            )

            parser.add_argument(
                "--export",
                choices=["csv", "json", "xlsx"],
                default="",
                type=str,
                dest="export",
                help="Export dataframe data to csv,json,xlsx file",
            )

            try:
                ns_parser = parse_known_args_and_warn(parser, other_args)

                if not ns_parser:
                    return

                pycoingecko_view.display_info(coin=self.current_coin,
                                              export=ns_parser.export)

            except Exception as e:
                print(e, "\n")

        else:
            print(
                "No coin selected. Use 'load' to load the coin you want to look at.\n"
            )
示例#3
0
 def test_coin_info(self):
     dd_pycoingecko_view.display_info(self.coin, export="")