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/" |
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
#!/usr/bin/env python3 | |
#Make sure the file is executable if you plan to run it as a module | |
#>>>./parse2.py Data/Raw/ | |
import os | |
import sys | |
from xml.etree import ElementTree | |
import csv | |
directory = sys.argv[1] |
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
#Emulates the logic in this Google Sheet: https://docs.google.com/spreadsheets/d/1iFbXhb_Jv_ZGh9Yzt8CtokU-LeLRoNxMPwN8e-iLlyU/edit?usp=sharing | |
#populate_charge_discharge_values("/Users/miriammakhyoun/Desktop/Python Class 2018/Energy Storage/data_analysis.csv",200,20,4,.8,30,.2) | |
import numpy as np | |
import pandas as pd | |
def populate_charge_discharge_values( | |
file_path, | |
max_budget, | |
max_capacity, |