Files
pricing/electricity_price_predictor/scripts/init_db.py
ddoebel 73641b7e5b Add electricity price ingestion and feature pipeline.
Introduce ENTSO-E data retrieval with layered caching, robust bidding-zone and missing-data handling, and persist model-ready features with detailed architecture/developer documentation.

Made-with: Cursor
2026-04-15 11:40:14 +02:00

24 lines
586 B
Python

from pathlib import Path
from sqlalchemy import text
from electricity_price_predictor.db import get_engine
def main() -> None:
engine = get_engine()
schema_path = Path(__file__).resolve().parents[1] / "sql" / "001_electricity_price_schema.sql"
sql = schema_path.read_text(encoding="utf-8")
with engine.begin() as conn:
for statement in sql.split(";"):
stmt = statement.strip()
if stmt:
conn.execute(text(stmt))
print("Schema initialized for electricity price predictor.")
if __name__ == "__main__":
main()