From 98691d55317aadf863de2ea4b4a587fa585fdbc2 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 5 Mar 2024 19:00:45 +0100 Subject: [PATCH] Feat: start CLI --- requirements.txt | 1 + scripts/__main__.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 scripts/__main__.py diff --git a/requirements.txt b/requirements.txt index 65a5a79..0653e55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ jupyter==1.0.0 pandas==1.5.0 pdf-oralia==0.3.11 pydantic==2.6.1 +click==8.1.7 diff --git a/scripts/__main__.py b/scripts/__main__.py new file mode 100644 index 0000000..dcfa96c --- /dev/null +++ b/scripts/__main__.py @@ -0,0 +1,42 @@ +import click + + +@click.group() +@click.option("--debug/--no-debug", default=False) +def main(debug): + if debug: + logging_level = logging.DEBUG + else: + logging_level = logging.INFO + logging_config = dict( + version=1, + formatters={"f": {"format": "%(levelname)-8s %(name)-12s %(message)s"}}, + handlers={ + "h": { + "class": "logging.StreamHandler", + "formatter": "f", + "level": logging_level, + } + }, + root={ + "handlers": ["h"], + "level": logging_level, + }, + ) + + dictConfig(logging_config) + + +@main.command() +def ingest(): + pass + + +@main.command() +def feature(): + pass + + +@main.command() +def datamart(): + pass