Initial commit: svg backend
This commit is contained in:
16
backend/app/services/normalized_reader.py
Normal file
16
backend/app/services/normalized_reader.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
def read_normalized_payload_from_path(normalized_storage_path: str) -> dict:
|
||||
path = Path(normalized_storage_path)
|
||||
|
||||
if not path.exists() or not path.is_file():
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="Normalized snapshot file not found",
|
||||
)
|
||||
|
||||
return json.loads(path.read_text(encoding="utf-8"))
|
||||
Reference in New Issue
Block a user