ErenEla / transparencyEpias

Package for EPIAS (Turkish Electricity Market Operating Company) Transparency API Service
MIT License
8 stars 2 forks source link

consumptionClient API gives error #1

Closed uozden closed 4 years ago

uozden commented 4 years ago

Dear @ErenEla
Your work is awesome, very handy. Cheers.

our script below:

from transparency_epias.consumption import consumptionClient
#consumption_official
consumptionClient.consumption.consumption_official(startDate ='2020-05-01', endDate='2020-05-01'

throws the following error;

TypeError Traceback (most recent call last)
<ipython-input-182-9d9c91aa7de6> in <module>
      1 from transparency_epias.consumption import consumptionClient
      2 #consumption_official
----> 3 consumptionClient.consumption.consumption_official(startDate ='2020-05-01', endDate='2020-05-01')

~\......\conda\3\lib\site-packages\transparency_epias\consumption\consumptionClient.py in consumption_official(self, startDate, endDate)
    308         consumption_list = []
    309 
--> 310         for item in response_list:
    311             date_list.append(item['date'])
    312             consumption_list.append(item['swv'])

TypeError: 'NoneType' object is not iterable
ErenEla commented 4 years ago

Dear, @uozden Thank you for your kind words, and contribution. There was a bug while creating the query which sends to the service. Bug has been fixed, and also new version has been released as well, now it should be okay.

Warning: The official values covers the previous month from now.If you try to get values from current month response will be empty list. (Official values should be released after 14th of every month.)

Thank you.