Last active
January 28, 2019 21:32
-
-
Save MiriamMakhyoun/5d13608aa64a3b810c458bb1128c2451 to your computer and use it in GitHub Desktop.
Step 1: Munging Data from California Independent System Operator's OASIS Platform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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