Exemple #1
0
    def call_social(self, other_args):
        """Process social command"""
        parser = argparse.ArgumentParser(
            add_help=False,
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            prog="social",
            description=
            """Shows social media corresponding to loaded coin. You can find there name of
            telegram channel, urls to twitter, reddit, bitcointalk, facebook and discord.""",
        )
        ns_parser = parse_known_args_and_warn(parser, other_args,
                                              EXPORT_ONLY_RAW_DATA_ALLOWED)

        if ns_parser:
            pycoingecko_view.display_social(self.coin_map_df["CoinGecko"],
                                            export=ns_parser.export)
    def call_social(self, other_args):
        """Process social command"""
        if self.current_coin:
            parser = argparse.ArgumentParser(
                add_help=False,
                formatter_class=argparse.ArgumentDefaultsHelpFormatter,
                prog="social",
                description=
                """Shows social media corresponding to loaded coin. You can find there name of
                telegram channel, urls to twitter, reddit, bitcointalk, facebook and discord.""",
            )

            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_social(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"
            )
Exemple #3
0
 def test_coin_social(self):
     dd_pycoingecko_view.display_social(self.coin, export="")