csv-to-marp-converter/config_parser.py
2021-06-17 18:40:31 +02:00

23 lines
619 B
Python

import yaml
import os
DEFAULT_CONFIG_FILE_NAME = "config.yml"
if os.environ['ENV'] == 'prod':
config_file_to_load = "config_prod.yml"
else:
config_file_to_load = DEFAULT_CONFIG_FILE_NAME
# BASE_FODLER = "/code/markdowntagebuch"
BASE_FODLER = os.path.dirname(os.path.abspath(__file__))
path_to_config = os.path.join(BASE_FODLER, config_file_to_load)
print("opening config file " + path_to_config)
with open(path_to_config, "r") as ymlfile:
cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)
credentials = cfg["auth"]
prod_mode = cfg["prod"]
output_path = cfg["outputPath"]
upload_path = cfg["uploadPath"]