Skip to content

Commit

Permalink
Start on US-FL SEC parser, just solar
Browse files Browse the repository at this point in the history
background in electricitymaps#1713. example output:

```json
[{
  'zoneKey': 'US-SEC'
  'datetime': "2019-07-02T11:00:00Z",
  'production': {'solar': 0.0125},
  'source': 'apps.seminole.coop',
 }, {
  'zoneKey': 'US-SEC'
  'datetime': "2019-07-02T12:00:00Z",
  'production': {'solar': 0.1269},
  'source': 'apps.seminole.coop',
 },
 ...
]
```
  • Loading branch information
snarfed committed Jul 25, 2019
1 parent bf041f3 commit 3753725
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 3753725

Please sign in to comment.