Skip to content

bryce-a-smith/energy-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Energy Grid API

A REST API built with FastAPI and Python that exposes energy grid status and distributed energy resource (DER) data. Built to demonstrate Python backend development with modern tooling relevant to the clean energy sector.

Live: https://api.aldenbryce.com Docs: https://api.aldenbryce.com/docs

Stack

  • Python 3.12
  • FastAPI
  • Pydantic (data validation and response models)
  • Uvicorn (ASGI server)
  • Deployed on Render, custom domain via AWS Route 53

Endpoints

Method Endpoint Description
GET /health Service health check
GET /grid/status Grid status by region. Optional ?region= filter
GET /ders List distributed energy resources. Optional ?der_id= filter

Running Locally

# Create and activate virtual environment
python -m venv venv
source venv/Scripts/activate  # Windows

# Install dependencies
pip install -r requirements.txt

# Start development server
uvicorn main:app --reload

Open http://localhost:8000/docs for interactive API documentation.

Example Requests

# All regions
GET /grid/status

# Filter by region
GET /grid/status?region=PJM

# All DERs
GET /ders

# Filter by ID
GET /ders?der_id=DER-002

Concepts Demonstrated

  • FastAPI route definitions with query parameters
  • Pydantic models for request validation and response documentation
  • Optional filtering with list comprehensions
  • Automatic OpenAPI/Swagger documentation generation
  • Python type hints throughout
  • Clean separation between data models and route handlers

About

FastAPI energy grid API with Pydantic models. Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages