diff --git a/matomo-api/src/cli.py b/matomo-api/src/cli.py index c464dc3..a8c24bb 100644 --- a/matomo-api/src/cli.py +++ b/matomo-api/src/cli.py @@ -7,14 +7,16 @@ @click.command() @click.option("--date", "-d", default=date.today()) def fetch_matomo_inspire_data(date: str): + click.echo(f"Fetching data for date {date}") if isinstance(date, str): try: - date_datetime = datetime.strptime(date, "%Y-%M-%d") + date = datetime.strptime(date, "%Y-%M-%d") except ValueError: click.echo("Wrong date format! Aborting.") + return matomo = MatomoAPI() - matomo.fetch_inspire_statistics(date_datetime) + matomo.fetch_inspire_statistics(date) if __name__ == "__main__":