{"id":32454278,"url":"https://github.com/bbartling/building-power-model-api","last_synced_at":"2026-07-05T22:31:30.038Z","repository":{"id":320783572,"uuid":"1083161058","full_name":"bbartling/building-power-model-api","owner":"bbartling","description":"Generic docker container for a building electrical power for use with a Niagara BAS and Java ProgramObject","archived":false,"fork":false,"pushed_at":"2025-10-25T20:12:11.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-10-25T22:13:21.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbartling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T13:18:54.000Z","updated_at":"2025-10-25T20:12:14.000Z","dependencies_parsed_at":"2025-10-25T22:13:24.354Z","dependency_job_id":"58ff8a3a-dc53-448d-816b-bf72f66120e6","html_url":"https://github.com/bbartling/building-power-model-api","commit_stats":null,"previous_names":["bbartling/building-power-model-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bbartling/building-power-model-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbartling%2Fbuilding-power-model-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbartling%2Fbuilding-power-model-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbartling%2Fbuilding-power-model-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbartling%2Fbuilding-power-model-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbartling","download_url":"https://codeload.github.com/bbartling/building-power-model-api/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbartling%2Fbuilding-power-model-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281074181,"owners_count":26439421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-26T07:58:57.467Z","updated_at":"2025-10-26T07:58:58.381Z","avatar_url":"https://github.com/bbartling.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# building-power-model-api\nGeneric docker container for a building electrical power for use with a Niagara BAS and Java ProgramObject\n\n\n\n## 1. Build the Image\n\nFrom the directory that contains your `Dockerfile`:\n\n```bash\n# Build and tag the image\ndocker build -t building-power-model-api:latest .\ndocker run -d --name building-power-model -p 8000:8000 building-power-model-api:latest\n```\n\n## 2. Build the Image\n\n💡 The app will now be live at\n[`http://127.0.0.1:8000`](http://127.0.0.1:8000)\nCheck it with:\n\n### Health Route\nLinux Bash\n```bash\ncurl http://127.0.0.1:8000/health\n```\n\nWindows Poweshell\n```powershell\nInvoke-WebRequest -Uri \"http://127.0.0.1:8000/health\" | Select-Object -ExpandProperty Content\n```\n\n### Info Route\nLinux Bash\n```bash\ncurl http://127.0.0.1:8000/info\n```\n\nWindows Poweshell\n```powershell\nInvoke-WebRequest -Uri \"http://127.0.0.1:8000/info\" | Select-Object -ExpandProperty Content\n```\n\n### Predict Route\nLinux Bash\n```bash\ncurl -X POST http://127.0.0.1:8000/predict_power \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"oat_f\": 92.5,\n        \"rh_pct\": 68.0,\n        \"solar_wft2\": 75.0,\n        \"timestamp_ms\": 1730150400000\n      }'\n\n```\n\nWindows Poweshell\n```powershell\n$payload = @{\n  oat_f        = 95.0\n  rh_pct       = 60.0\n  hour_of_day  = 15\n  day_of_week  = 2\n  timestamp_ms = [int64]([datetimeoffset]::UtcNow.ToUnixTimeMilliseconds())\n} | ConvertTo-Json\n\nInvoke-RestMethod -Uri \"http://127.0.0.1:8000/predict_power\" `\n  -Method Post `\n  -ContentType \"application/json\" `\n  -Body $payload | ConvertTo-Json -Depth 4\n\n```\n\n## Rebuild and Redeploy Commands\n\nIf you changed code in `app.py` or `requirements.txt`, do this:\n\n```bash\ndocker rm -f building-power-model \ndocker build -t building-power-model-api:latest . \ndocker run -d --name building-power-model -p 8000:8000 building-power-model-api:latest\n```\n\n\n---\n\n## Docker maintence commands\n\n```bash\n# List running containers\ndocker ps\n\n# List all containers (even stopped)\ndocker ps -a\n\n# List all images\ndocker images\n\n# Clean Up System-Wide\ndocker system prune -a --volumes -f\n```\n\n---\n\n## 🏗️ 9. Example “dev loop” workflow\n\n```bash\n# edit app.py\ndocker stop building-power-model\ndocker rm building-power-model\ndocker build -t building-power-model-api:latest .\ndocker run -d --name building-power-model -p 8000:8000 building-power-model-api:latest\ndocker logs -f building-power-model\n```\n\n---\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbartling%2Fbuilding-power-model-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbartling%2Fbuilding-power-model-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbartling%2Fbuilding-power-model-api/lists"}