Exemple #1
0
    def call_bc(self, other_args):
        """Process bc command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="bc",
            description="""
            Blockchain explorers URLs for loaded coin. Those are sites like etherescan.io or polkascan.io
            in which you can see all blockchain data e.g. all txs, all tokens, all contracts...
                                """,
        )
        ns_parser = parse_known_args_and_warn(parser, other_args,
                                              EXPORT_ONLY_RAW_DATA_ALLOWED)

        if ns_parser:
            pycoingecko_view.display_bc(self.coin_map_df["CoinGecko"],
                                        ns_parser.export)
    def call_bc(self, other_args):
        """Process bc command"""
        if self.current_coin:
            parser = argparse.ArgumentParser(
                add_help=False,
                formatter_class=argparse.ArgumentDefaultsHelpFormatter,
                prog="bc",
                description="""
                Blockchain explorers URLs for loaded coin. Those are sites like etherescan.io or polkascan.io
                in which you can see all blockchain data e.g. all txs, all tokens, all contracts...
                                    """,
            )

            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_bc(self.current_coin,
                                            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"
            )
Exemple #3
0
 def test_coin_bc(self):
     dd_pycoingecko_view.display_bc(self.coin, export="")