This commit is contained in:
2026-02-21 11:45:58 +01:00
commit 70ba4a0279
10 changed files with 270 additions and 0 deletions

23
core/config_loader.py Normal file
View File

@@ -0,0 +1,23 @@
import yaml
from pathlib import Path
CONFIG_PATH = Path(__file__).parent.parent / "config.yaml"
def load_config():
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
cfg = yaml.safe_load(f)
s_id = cfg['google_sheet']['sheet_id']
gid_t = cfg['google_sheet']['gid_times']
gid_r = cfg['google_sheet']['gid_remarks']
# Wir nutzen exakt das Format, das bei deinem ersten Test funktionierte
cfg['links'] = {
'times_csv': f"https://docs.google.com/spreadsheets/d/{s_id}/export?format=csv&gid={gid_t}",
'remarks_csv': f"https://docs.google.com/spreadsheets/d/{s_id}/export?format=csv&gid={gid_r}",
'times_edit': f"https://docs.google.com/spreadsheets/d/{s_id}/edit#gid={gid_t}",
'remarks_edit': f"https://docs.google.com/spreadsheets/d/{s_id}/edit#gid={gid_r}"
}
return cfg
config = load_config()