API: endpoint /schema (#78)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-05-13 14:10:20 +02:00
parent a05c869b0d
commit 6f4e7f1853
3 changed files with 54 additions and 0 deletions
+11
View File
@@ -1,5 +1,8 @@
from flask_smorest import Blueprint
from src.api.auth import require_token
from src.db import schema as duckdb_schema
bp = Blueprint(
"api_v1",
"api_v1",
@@ -12,3 +15,11 @@ bp = Blueprint(
def health():
"""Sonde de santé, sans authentification."""
return {"status": "ok"}
@bp.route("/schema")
@require_token
def schema():
"""Liste des colonnes disponibles dans le dataset DECP."""
cols = [{"name": name, "type": str(dtype)} for name, dtype in duckdb_schema.items()]
return {"columns": cols}