transparency_epias/consumption/consumptionClient.py
def consumption_official(self, startDate, endDate):

        '''
        This function returns a dictionary including;
            -Datetime list that covers the range of startDate and endDate parameters as first item. 
            -Officially aproved consumption amount as second item.

        Parameters:

        startDate: Start date in YYYY-MM-DD format.
        endDate: End date in YYYY-MM-DD format.

        '''

        val.date_check(startDate, endDate)

        query = "consumption/swv?"+"startDate="+f'{startDate}'+"&endDate="+f'{endDate}'

        json_result = self.get_request_result(query)

        key_list = list(json_result['body'].keys())

        key_name = key_list[0]

        response_list = json_result['body'][f'{key_name}']

        date_list = []
        consumption_list = []

        for item in response_list:
            date_list.append(item['date'])
            consumption_list.append(item['swv'])

        return date_list, consumption_list

        This function returns a dictionary including;
            -Datetime list that covers the range of startDate and endDate parameters as first item. 
            -Officially aproved consumption amount as second item.

        Parameters:

        startDate: Start date in YYYY-MM-DD format.
        endDate: End date in YYYY-MM-DD format.

        
This function returns a dictionary including;
Datetime list that covers the range of startDate and endDate parameters as first item.
Officially aproved consumption amount as second item.



Start date in YYYY-MM-DD format.
endDate: End date in YYYY-MM-DD format.
This function returns a dictionary including ; Datetime list that covers the range of startDate and endDate parameters as first item . Officially aproved consumption amount as second item . Start date in YYYY - MM - DD format . endDate : End date in YYYY - MM - DD format .
def consumption_official(self, startDate, endDate):
        val.date_check(startDate, endDate)
        query = "consumption/swv?"+"startDate="+f'{startDate}'+"&endDate="+f'{endDate}'
        json_result = self.get_request_result(query)
        key_list = list(json_result['body'].keys())
        key_name = key_list[0]
        response_list = json_result['body'][f'{key_name}']
        date_list = []
        consumption_list = []
        for item in response_list:
            date_list.append(item['date'])
            consumption_list.append(item['swv'])
        return date_list, consumption_list
def consumption_official ( self , startDate , endDate ) : val . date_check ( startDate , endDate ) query = "consumption/swv?" + "startDate=" + f'{startDate}' + "&endDate=" + f'{endDate}' json_result = self . get_request_result ( query ) key_list = list ( json_result [ 'body' ] . keys ( ) ) key_name = key_list [ 0 ] response_list = json_result [ 'body' ] [ f'{key_name}' ] date_list = [ ] consumption_list = [ ] for item in response_list : date_list . append ( item [ 'date' ] ) consumption_list . append ( item [ 'swv' ] ) return date_list , consumption_list
This function returns a dictionary including;
Datetime list that covers the range of startDate and endDate parameters as first item.
This function returns a dictionary including ; Datetime list that covers the range of startDate and endDate parameters as first item .
'''
        This function returns a dictionary including;
            -Datetime list that covers the range of startDate and endDate parameters as first item. 
            -Officially aproved consumption amount as second item.

        Parameters:

        startDate: Start date in YYYY-MM-DD format.
        endDate: End date in YYYY-MM-DD format.

        '''
self
startDate
endDate