コード例 #1
0
    def call_atl(self, other_args):
        """Process atl command"""
        if self.current_coin:
            parser = argparse.ArgumentParser(
                add_help=False,
                formatter_class=argparse.ArgumentDefaultsHelpFormatter,
                prog="atl",
                description="""All time low data for loaded coin""",
            )

            parser.add_argument(
                "--vs",
                dest="vs",
                help="currency",
                default="usd",
                choices=["usd", "btc"],
            )

            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_atl(self.current_coin, ns_parser.vs,
                                             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"
            )
コード例 #2
0
    def call_atl(self, other_args):
        """Process atl command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="atl",
            description="""All time low data for loaded coin""",
        )

        parser.add_argument(
            "--vs",
            dest="vs",
            help="currency",
            default="usd",
            choices=FILTERS_VS_USD_BTC,
        )
        ns_parser = parse_known_args_and_warn(parser, other_args,
                                              EXPORT_ONLY_RAW_DATA_ALLOWED)

        if ns_parser:
            pycoingecko_view.display_atl(self.coin_map_df["CoinGecko"],
                                         ns_parser.vs, ns_parser.export)
コード例 #3
0
 def test_coin_atl(self):
     dd_pycoingecko_view.display_atl(self.coin, export="", currency="usd")