diff --git a/open_notebook/config.py b/open_notebook/config.py new file mode 100644 index 0000000..2adf1a7 --- /dev/null +++ b/open_notebook/config.py @@ -0,0 +1,17 @@ +import os + +import yaml +from loguru import logger + +# todo: enable config file overwrite with env vars +current_dir = os.path.dirname(os.path.abspath(__file__)) +project_root = os.path.dirname(current_dir) +config_path = os.path.join(project_root, "open_notebook_config.yaml") + +try: + with open(config_path, "r") as file: + CONFIG = yaml.safe_load(file) +except Exception: + logger.critical("Config file not found, using empty defaults") + logger.debug(f"Looked in {config_path}") + CONFIG = {} diff --git a/open_notebook_config.yaml b/open_notebook_config.yaml new file mode 100644 index 0000000..280c2a4 --- /dev/null +++ b/open_notebook_config.yaml @@ -0,0 +1,13 @@ + +youtube_transcripts: + preferred_languages: + - en + - pt + - es + - de + - nl + - en-GB + - fr + - de + - hi + - ja \ No newline at end of file