Spaces:
Sleeping
Sleeping
Download app.py from Stephan86/pdf-csv-agent: direct link, hf CLI and curl.
- Browser
- Download file 812 Bytes
-
https://huggingface.co/spaces/Stephan86/pdf-csv-agent/resolve/main/app.py
- Command line
-
hf download hf://spaces/Stephan86/pdf-csv-agent/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Stephan86/pdf-csv-agent/resolve/main/app.py
812 Bytes
| """ | |
| Point d'entrée du Space : FastAPI minimal + UI Gradio à onglets servie sur /. | |
| Une seule page, deux onglets : | |
| - 🧹 Nettoyeur CSV (core.cleaner — 100 % local, sans IA) | |
| - 📄 CSV → EBP (mapping colonnes → EBP, aperçu éditable, export 1 seul CSV | |
| EBP : 9 colonnes + Taux de marge) | |
| Lancement (Docker) : uvicorn app:app --host 0.0.0.0 --port 7860 | |
| """ | |
| from dotenv import load_dotenv | |
| from fastapi import FastAPI | |
| from fastapi.responses import JSONResponse | |
| import gradio as gr | |
| from app_gradio import demo | |
| load_dotenv() | |
| app = FastAPI(title="Atelier EBP — Nettoyeur CSV + Extracteur PDF") | |
| async def ping(): | |
| return JSONResponse({"ok": True}) | |
| # UI Gradio (les deux onglets) montée à la racine. | |
| app = gr.mount_gradio_app(app, demo, path="/") | |