def competition_prompt(api: KaggleApi) -> str: competition_query = click.prompt("competition", default="", show_default=False) competitions = api.competitions_list(search=competition_query) for i, c in enumerate(competitions): click.echo(f"{i} {c}") competition_index = click.prompt(">", type=int, show_choices=False, prompt_suffix=" ") return str(competitions[competition_index])
def get_notify_competitions_list(): try: api = KaggleApi() api.authenticate() competitions_list = [] for info in api.competitions_list(sort_by='recentlyCreated'): competition = Competition(info) if competition.notify_message != DO_NOT_NOTIFY: competitions_list.append(competition) return competitions_list except Exception as e: logger.error(e)