Skip to content

Instantly share code, notes, and snippets.

@MiriamMakhyoun
Last active January 28, 2019 21:32
Show Gist options
  • Save MiriamMakhyoun/5d13608aa64a3b810c458bb1128c2451 to your computer and use it in GitHub Desktop.
Save MiriamMakhyoun/5d13608aa64a3b810c458bb1128c2451 to your computer and use it in GitHub Desktop.
Step 1: Munging Data from California Independent System Operator's OASIS Platform
#gets data from API
import requests
from io import BytesIO
from zipfile import ZipFile
def QueryAPI(query_name):
api_url=f'http://oasis.caiso.com/oasisapi/SingleZip?queryname={query_name}&startdatetime=20180919T07:00-0000&enddatetime=20180920T07:00-0000&market_run_id=DAM&version=1'
response = requests.get(api_url)
zipfile = ZipFile(BytesIO(response.content))
output_url="/Users/miriammakhyoun/Desktop/Python Class 2018/Energy Storage/Data/Raw/"
zipfile.extractall(output_url)
QueryAPI('PRC_LMP')
QueryAPI('PRC_AS')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment