7-шаговый wizard: загрузка ZIP+целевой → поиск по ключевому слову → выбор колонок → сопоставление → превью → применение → скачивание. FastAPI + vanilla JS (Bootstrap 5), порт 8102. Протестировано на реальных данных: 4 ресурсных ведомости → Сводка стоимости затрат труда (19 обновлений + 10 новых разрядов). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
780 B
Python
32 lines
780 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Wizard-aggregator web server.
|
|
|
|
Usage:
|
|
python scripts/wizard_server.py
|
|
# Open http://localhost:8102/wizard.html
|
|
"""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Ensure src/ is on path
|
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.staticfiles import StaticFiles
|
|
|
|
from smeta_railway.web.wizard_api import router
|
|
|
|
app = FastAPI(title="Smeta Wizard Aggregator")
|
|
app.include_router(router, prefix="/api/wizard")
|
|
|
|
# Serve static files (wizard.html)
|
|
static_dir = Path(__file__).resolve().parent.parent / "static"
|
|
app.mount("/", StaticFiles(directory=str(static_dir), html=True), name="static")
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
|
|
uvicorn.run(app, host="0.0.0.0", port=8102)
|