Skip to content

Commit

Permalink
Start on US-FL SEC parser, with solar
Browse files Browse the repository at this point in the history
background in electricitymaps#1713. this commit just adds solar.
  • Loading branch information
snarfed committed Jul 2, 2019
1 parent c3e2bc6 commit 5427117
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions parsers/US_SEC.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3

"""Parser for the Seminole Electric Cooperative in Florida, USA.
https://github.com/tmrowco/electricitymap-contrib/issues/1713
"""

import logging
from datetime import timezone

import pandas as pd


def fetch_solar(session=None, logger=logging.getLogger(__name__)):
url = 'http://apps.seminole.coop/db/cs/render.ashx?ItemPath=/Applications/Solar+Dashboard/Cooperative+Solar+-+Data&Format=EXCEL&rptHDInterval=Day&rptHDOffset=0'
df = pd.read_excel(url, sheet_name='Hourly', skiprows=[0])

return [{
'zoneKey': 'US_SEC',
'datetime': row['Date/Time (UTC)'].to_pydatetime().replace(tzinfo=timezone.utc),
'production': {'solar': row['kW'] / 1000.0},
'source': 'apps.seminole.coop',
} for _, row in df.iterrows()]



if __name__ == '__main__':
"""Main method, not used by the ElectricityMap backend, just for testing."""

import json, pprint
print('fetch_solar() ->')
print(pprint.pprint(fetch_solar()))

0 comments on commit 5427117

Please sign in to comment.