Spaces:
Sleeping
Sleeping
| title: NEM Solar Predictor | |
| emoji: "☀️" | |
| colorFrom: yellow | |
| colorTo: blue | |
| sdk: gradio | |
| sdk_version: 5.12.0 | |
| python_version: 3.11 | |
| license: mit | |
| # NEM Solar Predictor | |
| Simple dashboard + API for: | |
| - Current regional solar generation (both `rooftop` and `utility`) | |
| - Short-horizon forecasts at `+5m`, `+15m`, `+30m` | |
| ## Live data | |
| The app first tries Open Electricity for the **latest 5-minute snapshot** and falls back to local data if live fetch fails. | |
| Set this secret in Hugging Face Space settings: | |
| - `OPENELECTRICITY_API_KEY` | |
| ## API endpoints | |
| - `/refresh_solar_dashboard` | |
| - `/refresh_solar_dashboard_1` | |
| Both return: | |
| 1. Summary string | |
| 2. Regional table | |
| 3. Raw JSON payload | |
| ## Use via API | |
| ```bash | |
| pip install gradio_client | |
| ``` | |
| ```python | |
| from gradio_client import Client | |
| client = Client("YOUR_ORG/YOUR_SPACE") | |
| summary, table, payload = client.predict(api_name="/refresh_solar_dashboard") | |
| print(summary) | |
| print(table) | |
| print(payload) | |
| ``` | |
| ## Local run | |
| ```bash | |
| cd solar-api | |
| pip install -r requirements.txt | |
| python app.py | |
| ``` | |