Files
LetCTF/src/utils/config_handler.py
√(noham)² 49375f3dd1 first push
2025-02-17 01:02:43 +01:00

18 lines
448 B
Python

import json
from typing import Dict
from pathlib import Path
def load_config(file_path: str | Path) -> Dict:
"""Load configuration from a JSON file
Expected format:
{
"token": "your_token",
"provider": "provider_name"
}
"""
path = Path(file_path)
if not path.exists():
raise FileNotFoundError(f"Config file not found: {file_path}")
with open(path, 'r') as f:
return json.load(f)