示例#1
0
def fetch_consumption(country_code='IN-PB', session=None):
    """Fetch Punjab consumption"""
    countrycode.assert_country_code(country_code, 'IN-PB')
    response_text = web.get_response_text(country_code, 'http://www.punjabsldc.org/nrrealw.asp?pg=nrGenReal',
                                          session)
    date_text = read_text_by_regex('(\d+/\d+/\d+)', response_text)
    time_text = read_text_by_regex('(\d+:\d+:\d+)', response_text)
    
    india_date = date_time_strings_to_kolkata_date(date_text, "DD/MM/YYYY", time_text, "HH:mm:ss")

    punjab_match = search('<tr>(.*?)PUNJAB(.*?)</tr>', response_text, M|I|S).group(0)
    punjab_tr_text = findall('<tr>(.*?)</tr>', punjab_match, M|I|S)[1]

    punjab_text_font_cleaned = sub('<font(.*?)>', '', sub('</font>', '', punjab_tr_text))
    punjab_text_bold_cleaned = sub('<b>', '', sub('</b>', '', punjab_text_font_cleaned))
    punjab_text_paragraph_cleaned = sub('<p(.*?)>', '', sub('&nbsp;', '', punjab_text_bold_cleaned))

    punjab_soap = BeautifulSoup(punjab_text_paragraph_cleaned, 'html.parser')
    consumption_td = punjab_soap.findAll('td')[3]

    data = {
        'countryCode': country_code,
        'datetime': india_date.datetime,
        'consumption': float(consumption_td.text),
        'source': 'punjasldc.org'
    }

    return data
示例#2
0
def fetch_production(country_code='IN-CT', session=None):
    """Fetch Chhattisgarh production"""
    countrycode.assert_country_code(country_code, 'IN-CT')

    html = web.get_response_soup(country_code, 'http://117.239.199.203/csptcl/GEN.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'L37', 'hh:m DD-MM-YY')

    korba_east_value = IN.read_value_from_span_id(html, 'L7')

    korba_west_value = IN.read_value_from_span_id(html, 'L13')

    dsmp_value = IN.read_value_from_span_id(html, 'L16')

    marwa_value = IN.read_value_from_span_id(html, 'L23')

    coal_value = round(korba_east_value + korba_west_value + dsmp_value + marwa_value, 2)

    bango_value = IN.read_value_from_span_id(html, 'L20')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'coal': coal_value,
            'hydro': bango_value
        },
        'source': 'cspc.co.in',
    }

    return data
示例#3
0
def fetch_production(country_code='IN-CT', session=None):
    """Fetch Chhattisgarh production"""
    countrycode.assert_country_code(country_code, 'IN-CT')

    html = web.get_response_soup(country_code, 'http://117.239.199.203/csptcl/GEN.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'L37', 'hh:m DD-MM-YY')

    korba_east_value = IN.read_value_from_span_id(html, 'L7')

    korba_west_value = IN.read_value_from_span_id(html, 'L13')

    dsmp_value = IN.read_value_from_span_id(html, 'L16')

    marwa_value = IN.read_value_from_span_id(html, 'L23')

    coal_value = round(korba_east_value + korba_west_value + dsmp_value + marwa_value, 2)

    bango_value = IN.read_value_from_span_id(html, 'L20')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'coal': coal_value,
            'hydro': bango_value
        },
        'source': 'cspc.co.in',
    }

    return data
示例#4
0
def fetch_consumption(country_code='IN-PB', session=None):
    """Fetch Punjab consumption"""
    countrycode.assert_country_code(country_code, 'IN-PB')
    response_text = web.get_response_text(country_code, 'http://www.punjabsldc.org/nrrealw.asp?pg=nrGenReal',
                                          session)
    date_text = read_text_by_regex('(\d+/\d+/\d+)', response_text)
    time_text = read_text_by_regex('(\d+:\d+:\d+)', response_text)
    
    india_date = date_time_strings_to_kolkata_date(date_text, "MM/DD/YYYY", time_text, "HH:mm:ss")

    punjab_match = search('<tr>(.*?)PUNJAB(.*?)</tr>', response_text, M|I|S).group(0)
    punjab_tr_text = findall('<tr>(.*?)</tr>', punjab_match, M|I|S)[1]

    punjab_text_font_cleaned = sub('<font(.*?)>', '', sub('</font>', '', punjab_tr_text))
    punjab_text_bold_cleaned = sub('<b>', '', sub('</b>', '', punjab_text_font_cleaned))
    punjab_text_paragraph_cleaned = sub('<p(.*?)>', '', sub('&nbsp;', '', punjab_text_bold_cleaned))

    punjab_soap = BeautifulSoup(punjab_text_paragraph_cleaned, 'html.parser')
    consumption_td = punjab_soap.findAll('td')[3]

    data = {
        'countryCode': country_code,
        'datetime': india_date.datetime,
        'consumption': float(consumption_td.text),
        'source': 'punjasldc.org'
    }

    return data
示例#5
0
def fetch_production(country_code='IN-DL', session=None):
    """Fetch Delhi production"""
    countrycode.assert_country_code(country_code, 'IN-DL')

    html = web.get_response_soup(
        country_code, 'http://www.delhisldc.org/Redirect.aspx?Loc=0804',
        session)

    india_date_string = IN.read_text_from_span_id(
        html, 'ContentPlaceHolder3_ddgenco')
    india_date_time = IN.read_datetime_with_only_time(india_date_string,
                                                      'HH:mm:ss')

    prod_table = html.find("table", {"id": "ContentPlaceHolder3_dgenco"})
    prod_rows = prod_table.findAll('tr')

    # BTPS https://en.wikipedia.org/wiki/Badarpur_Thermal_Power_Station
    btps = read_value(prod_rows[1])

    # CCGT https://en.wikipedia.org/wiki/Pragati-III_Combined_Cycle_Power_Plant
    ccgt = read_value(prod_rows[2])

    # DMSWSL Unknown
    dmswsl = read_value(prod_rows[3])

    # EDWPL Unknown
    edwpl = read_value(prod_rows[4])

    # GT Unknown
    gt = read_value(prod_rows[5])

    # Pragati
    pragati = read_value(prod_rows[6])

    # TOWMP Waste?
    towmp = read_value(prod_rows[7])

    # Coal production
    coal = btps

    # Gas production
    gas = ccgt + pragati

    # Unknown production
    unknown_value = dmswsl + edwpl + gt + towmp

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'coal': coal,
            'gas': gas,
            'unknown': unknown_value
        },
        'source': 'delhisldc.org',
    }

    return data
示例#6
0
def fetch_production(country_code='IN-DL', session=None):
    """Fetch Delhi production"""
    countrycode.assert_country_code(country_code, 'IN-DL')

    html = web.get_response_soup(
        country_code, 'http://www.delhisldc.org/Redirect.aspx?Loc=0804',
        session)

    india_date_string = IN.read_text_from_span_id(
        html, 'ContentPlaceHolder3_ddgenco')
    india_date_time = IN.read_datetime_with_only_time(india_date_string,
                                                      'HH:mm:ss')

    prod_table = html.find("table", {"id": "ContentPlaceHolder3_dgenco"})
    prod_rows = prod_table.findAll('tr')

    # BTPS https://en.wikipedia.org/wiki/Badarpur_Thermal_Power_Station
    btps = read_value(prod_rows[1])

    # CCGT https://en.wikipedia.org/wiki/Pragati-III_Combined_Cycle_Power_Plant = Pragati-3
    ccgt = read_value(prod_rows[2])

    # DMSWSL (Delhi Municipal Solid Waste Solutions Limited): Garbage-to-electricity
    dmswsl = read_value(prod_rows[3])

    # EDWPL (East Delhi Waste Processing Company Limited): Garbage-to-electricity
    edwpl = read_value(prod_rows[4])

    # GT (Gas Turbine) https://en.wikipedia.org/wiki/IPGCL_Gas_Turbine_Power_Station
    gt = read_value(prod_rows[5])

    # Pragati https://en.wikipedia.org/wiki/Pragati-I_Combined_Cycle_Gas_Power_Station = Pragati-1
    pragati = read_value(prod_rows[6])

    # TOWMP (Timarpur Okhla Waste Management Company Pvt. Ltd.): Garbage-to-electricity
    towmp = read_value(prod_rows[7])

    # Coal production
    coal = btps

    # Gas production
    gas = ccgt + pragati + gt

    # Unknown production
    garbage = dmswsl + edwpl + towmp

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'coal': coal,
            'gas': gas,
            'biomass': garbage
        },
        'source': 'delhisldc.org',
    }

    return data
示例#7
0
def fetch_production(country_code='IN-PB', session=None):
    """Fetch Punjab production"""
    countrycode.assert_country_code(country_code, 'IN-PB')
    response_text = web.get_response_text(
        country_code, 'http://www.punjabsldc.org/pungenrealw.asp?pg=pbGenReal',
        session)

    time_text = read_text_by_regex('(\d+:\d+:\d+)', response_text)

    utc = utcnow().floor('hour')
    india_now = utc.to('Asia/Kolkata')
    time = get(time_text, 'HH:mm:ss')
    india_date = india_now.replace(hour=time.hour,
                                   minute=time.minute,
                                   second=time.second)
    if india_date > india_now:
        india_date.shift(days=-1)

    solar_match = search('Total Solar Generation = \d+', response_text)
    solar_text = solar_match.group(0)
    solar_value = findall('\d+', solar_text)[0]

    hydro_match = search('Total Hydro = \d+', response_text)
    hydro_text = hydro_match.group(0)
    hydro_value = findall('\d+', hydro_text)[0]

    thermal_match = search('Total Thermal = \d+', response_text)
    thermal_text = thermal_match.group(0)
    thermal_value = findall('\d+', thermal_text)[0]

    ipp_match = search('Total IPPs = \d+', response_text)
    ipp_text = ipp_match.group(0)
    ipp_value = findall('\d+', ipp_text)[0]

    data = {
        'countryCode': country_code,
        'datetime': india_date.datetime,
        'production': {
            'biomass': 0.0,
            'coal': round(float(thermal_value) + float(ipp_value), 2),
            'gas': 0.0,
            'hydro': float(hydro_value),
            'nuclear': 0.0,
            'oil': 0.0,
            'solar': float(solar_value),
            'wind': 0.0,
            'geothermal': 0.0,
            'unknown': 0.0
        },
        'storage': {
            'hydro': 0.0
        },
        'source': 'punjasldc.org',
    }

    return data
示例#8
0
def fetch_production(country_code='IN-DL', session=None):
    """Fetch Delhi production"""
    countrycode.assert_country_code(country_code, 'IN-DL')

    html = web.get_response_soup(country_code, 'http://www.delhisldc.org/Redirect.aspx?Loc=0804', session)

    india_date_string = IN.read_text_from_span_id(html, 'ContentPlaceHolder3_ddgenco')
    india_date_time = IN.read_datetime_with_only_time(india_date_string, 'HH:mm:ss')

    prod_table = html.find("table", {"id": "ContentPlaceHolder3_dgenco"})
    prod_rows = prod_table.findAll('tr')

    # BTPS https://en.wikipedia.org/wiki/Badarpur_Thermal_Power_Station
    btps = read_value(prod_rows[1])

    # CCGT https://en.wikipedia.org/wiki/Pragati-III_Combined_Cycle_Power_Plant
    ccgt = read_value(prod_rows[2])

    # DMSWSL Unknown
    dmswsl = read_value(prod_rows[3])

    # EDWPL Unknown
    edwpl = read_value(prod_rows[4])

    # GT Unknown
    gt = read_value(prod_rows[5])

    # Pragati
    pragati = read_value(prod_rows[6])

    # TOWMP Waste?
    towmp = read_value(prod_rows[7])

    # Coal production
    coal = btps

    # Gas production
    gas = ccgt + pragati

    # Unknown production
    unknown_value = dmswsl + edwpl + gt + towmp

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'coal': coal,
            'gas': gas,
            'unknown': unknown_value
        },
        'source': 'delhisldc.org',
    }

    return data
示例#9
0
def fetch_production(country_code='IN-PB', session=None):
    """Fetch Punjab production"""
    countrycode.assert_country_code(country_code, 'IN-PB')
    response_text = web.get_response_text(country_code, 'http://www.punjabsldc.org/pungenrealw.asp?pg=pbGenReal', session)

    time_text = read_text_by_regex('(\d+:\d+:\d+)', response_text)

    utc = utcnow().floor('hour')
    india_now = utc.to('Asia/Kolkata')
    time = get(time_text, 'HH:mm:ss')
    india_date = india_now.replace(hour=time.hour, minute=time.minute, second=time.second)
    if india_date > india_now:
        india_date.shift(days=-1)

    solar_match = search('Total Solar Generation = \d+', response_text)
    solar_text = solar_match.group(0)
    solar_value = findall('\d+', solar_text)[0]

    hydro_match = search('Total Hydro = \d+', response_text)
    hydro_text = hydro_match.group(0)
    hydro_value = findall('\d+', hydro_text)[0]

    thermal_match = search('Total Thermal = \d+', response_text)
    thermal_text = thermal_match.group(0)
    thermal_value = findall('\d+', thermal_text)[0]

    ipp_match = search('Total IPPs = \d+',response_text)
    ipp_text = ipp_match.group(0)
    ipp_value = findall('\d+', ipp_text)[0]

    data = {
        'countryCode': country_code,
        'datetime': india_date.datetime,
        'production': {
            'biomass': 0.0,
            'coal': round(float(thermal_value) + float(ipp_value), 2),
            'gas': 0.0,
            'hydro': float(hydro_value),
            'nuclear': 0.0,
            'oil': 0.0,
            'solar': float(solar_value),
            'wind': 0.0,
            'geothermal': 0.0,
            'unknown': 0.0
        },
        'storage': {
            'hydro': 0.0
        },
        'source': 'punjasldc.org',
    }

    return data
示例#10
0
def fetch_consumption(country_code='IN-DL', session=None):
    """Fetch Delhi consumption"""
    countrycode.assert_country_code(country_code, 'IN-DL')
    html = web.get_response_soup(country_code, 'http://www.delhisldc.org/Redirect.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'DynamicData1_LblDate', 'DD-MMM-YYYY hh:mm:ss A')

    demand_value = IN.read_value_from_span_id(html, 'DynamicData1_LblLoad')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'consumption': demand_value,
        'source': 'delhisldc.org'
    }

    return data
示例#11
0
def fetch_consumption(country_code='IN-CT', session=None):
    """Fetch Chhattisgarh consumption"""
    countrycode.assert_country_code(country_code, 'IN-CT')
    html = web.get_response_soup(country_code, 'http://117.239.199.203/csptcl/GEN.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'L37', 'hh:m DD-MM-YY')

    demand_value = IN.read_value_from_span_id(html, 'L29')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'consumption': demand_value,
        'source': 'cspc.co.in'
    }

    return data
示例#12
0
def fetch_consumption(country_code='IN-KA', session=None):
    """Fetch Karnataka consumption"""
    countrycode.assert_country_code(country_code, 'IN-KA')
    html = web.get_response_soup(country_code, 'http://kptclsldc.com/Default.aspx', session)

    india_date_time = india.read_datetime_from_span_id(html, 'Label6', 'DD/MM/YYYY HH:mm')

    demand_value = india.read_value_from_span_id(html, 'Label5')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'consumption': demand_value,
        'source': 'kptclsldc.com'
    }

    return data
示例#13
0
def fetch_consumption(country_code='IN-CT', session=None):
    """Fetch Chhattisgarh consumption"""
    countrycode.assert_country_code(country_code, 'IN-CT')
    html = web.get_response_soup(country_code, 'http://117.239.199.203/csptcl/GEN.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'L37', 'hh:m DD-MM-YY')

    demand_value = IN.read_value_from_span_id(html, 'L29')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'consumption': demand_value,
        'source': 'cspc.co.in'
    }

    return data
示例#14
0
def fetch_consumption(country_code='IN-KA', session=None):
    """Fetch Karnataka consumption"""
    countrycode.assert_country_code(country_code, 'IN-KA')
    html = web.get_response_soup(country_code, 'http://kptclsldc.com/Default.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'Label6', 'DD/MM/YYYY HH:mm')

    demand_value = IN.read_value_from_span_id(html, 'Label5')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'consumption': demand_value,
        'source': 'kptclsldc.com'
    }

    return data
示例#15
0
def fetch_consumption(country_code='IN-DL', session=None):
    """Fetch Delhi consumption"""
    countrycode.assert_country_code(country_code, 'IN-DL')
    html = web.get_response_soup(country_code,
                                 'http://www.delhisldc.org/Redirect.aspx',
                                 session)

    india_date_time = IN.read_datetime_from_span_id(html,
                                                    'DynamicData1_LblDate',
                                                    'DD-MMM-YYYY hh:mm:ss A')

    demand_value = IN.read_value_from_span_id(html, 'DynamicData1_LblLoad')

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'consumption': demand_value,
        'source': 'delhisldc.org'
    }

    return data
    def test_assert_country_code(self):
        try:
            countrycode.assert_country_code('ES', 'ES', 'ESIOS')
        except ParserException as ex:
            self.fail("assert_country_code() raised ParserException unexpectedly!")

        try:
            countrycode.assert_country_code('ES', 'ES-IB')
        except ParserException as ex:
            self.assertIsInstance(ex, ParserException)
            self.assertEquals(str(ex), "ES Parser (ES): Country_code expected ES-IB, is ES")

        try:
            countrycode.assert_country_code('ES', 'ES-IB', 'ESIOS')
        except ParserException as ex:
            self.assertIsInstance(ex, ParserException)
            self.assertEquals(str(ex), "ESIOS Parser (ES): Country_code expected ES-IB, is ES")
示例#17
0
def fetch_production(country_code='IN-KA', session=None):
    """Fetch Karnataka  production"""
    countrycode.assert_country_code(country_code, 'IN-KA')

    html = web.get_response_soup(country_code, 'http://kptclsldc.com/StateGen.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'lbldate', 'M/D/YYYY h:mm:ss A')

    # RTPS Production: https://en.wikipedia.org/wiki/Raichur_Thermal_Power_Station
    rtps_value = IN.read_value_from_span_id(html, 'lblrtptot')

    # BTPS Production: https://en.wikipedia.org/wiki/Bellary_Thermal_Power_station
    btps_value = IN.read_value_from_span_id(html, 'lblbtptot')

    # YTPS Production: https://en.wikipedia.org/wiki/Yermarus_Thermal_Power_Station
    ytps_value = IN.read_value_from_span_id(html, 'ytptot')

    # UPCL Production: https://en.wikipedia.org/wiki/Udupi_Power_Plant
    upcl_value = IN.read_value_from_span_id(html, 'lblupctot')

    # JINDAl Production
    jindal_value = IN.read_value_from_span_id(html, 'lbljintot')

    # Coal Production
    coal_value = rtps_value + btps_value + ytps_value + upcl_value + jindal_value

    # Sharavati Production
    sharavati_value = IN.read_value_from_span_id(html, 'lblshvytot')

    # Nagjhari Production
    nagjhari_value = IN.read_value_from_span_id(html, 'lblngjtot')

    # Varahi Production
    varahi_value = IN.read_value_from_span_id(html, 'lblvrhtot')

    # Kodsalli Production
    kodsalli_value = IN.read_value_from_span_id(html, 'lblkdsltot')

    # Kadra Production
    kadra_value = IN.read_value_from_span_id(html, 'lblkdrtot')

    # GERUSOPPA production
    gerusoppa_value = IN.read_value_from_span_id(html, 'lblgrsptot')

    # JOG production
    jog_value = IN.read_value_from_span_id(html, 'lbljogtot')

    # LPH Production
    lph_value = IN.read_value_from_span_id(html, 'lbllphtot')

    # Supa production
    supa_value = IN.read_value_from_span_id(html, 'lblsupatot')

    # SHIMSHA
    shimsha_value = IN.read_value_from_span_id(html, 'lblshimtot')

    # SHIVASAMUDRA
    shivasamudra_value = IN.read_value_from_span_id(html, 'lblshivtot')

    # MANIDAM
    manidam_value = IN.read_value_from_span_id(html, 'lblmanitot')

    # MUNRABAD
    munrabad_value = IN.read_value_from_span_id(html, 'lblmbdtot')

    # BHADRA
    bhadra_value = IN.read_value_from_span_id(html, 'lblbdratot')

    # GHATAPRABHA
    ghataprabha_value = IN.read_value_from_span_id(html, 'lblgtprtot')

    # ALMATTI
    almatti_value = IN.read_value_from_span_id(html, 'lblalmttot')

    # CGS Production
    # TODO: Search CGS production type
    cgs_value = IN.read_value_from_span_id(html, 'lblcgs')

    # NCEP Production
    ncep_html = web.get_response_soup(country_code, 'http://kptclsldc.com/StateNCEP.aspx', session)
    ncep_date_time = IN.read_datetime_from_span_id(ncep_html, 'Label1', 'DD/MM/YYYY HH:mm:ss')

    # Check ncep date is similar than state gen date
    if abs(india_date_time.timestamp - ncep_date_time.timestamp) > 600:
        raise ParserException('IN-KA', 'NCEP or State datetime is not valid')

    biomass_value = IN.read_value_from_span_id(ncep_html, 'lbl_tb')

    # TODO: Cogeneration value production type?
    cogen_value = IN.read_value_from_span_id(ncep_html, 'lbl_tc')

    mini_hydro_value = IN.read_value_from_span_id(ncep_html, 'lbl_tm')

    wind_value = IN.read_value_from_span_id(ncep_html, 'lbl_tw')

    solar_value = IN.read_value_from_span_id(ncep_html, 'lbl_ts')

    # Hydro production
    hydro_value = sharavati_value + nagjhari_value + varahi_value + kodsalli_value \
                  + kadra_value + gerusoppa_value + jog_value + lph_value + supa_value \
                  + shimsha_value + shivasamudra_value + manidam_value + munrabad_value \
                  + bhadra_value + ghataprabha_value + almatti_value + mini_hydro_value

    # Unknown production
    unknown_value = cgs_value + cogen_value

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'biomass': biomass_value,
            'coal': coal_value,
            'gas': 0.0,
            'hydro': hydro_value,
            'nuclear': 0.0,
            'oil': 0.0,
            'solar': solar_value,
            'wind': wind_value,
            'geothermal': 0.0,
            'unknown': unknown_value
        },
        'storage': {
            'hydro': 0.0
        },
        'source': 'kptclsldc.com',
    }

    return data
示例#18
0
def fetch_production(country_code='IN-KA', session=None):
    """Fetch Karnataka  production"""
    countrycode.assert_country_code(country_code, 'IN-KA')

    html = web.get_response_soup(country_code,
                                 'http://kptclsldc.com/StateGen.aspx', session)

    india_date_time = IN.read_datetime_from_span_id(html, 'lbldate',
                                                    'M/D/YYYY h:mm:ss A')

    # RTPS Production: https://en.wikipedia.org/wiki/Raichur_Thermal_Power_Station
    rtps_value = IN.read_value_from_span_id(html, 'lblrtptot')

    # BTPS Production: https://en.wikipedia.org/wiki/Bellary_Thermal_Power_station
    btps_value = IN.read_value_from_span_id(html, 'lblbtptot')

    # YTPS Production: https://en.wikipedia.org/wiki/Yermarus_Thermal_Power_Station
    ytps_value = IN.read_value_from_span_id(html, 'ytptot')

    # UPCL Production: https://en.wikipedia.org/wiki/Udupi_Power_Plant
    upcl_value = IN.read_value_from_span_id(html, 'lblupctot')

    # JINDAl Production: https://en.wikipedia.org/wiki/JSW_Vijayanagar_Power_Station
    jindal_value = IN.read_value_from_span_id(html, 'lbljintot')

    # Coal Production
    coal_value = rtps_value + btps_value + ytps_value + upcl_value + jindal_value

    # Sharavati Production: Sharavati  Hydroelectric
    sharavati_value = IN.read_value_from_span_id(html, 'lblshvytot')

    # Nagjhari Production: Kalinadi-Nagjhari Hydroelectric
    nagjhari_value = IN.read_value_from_span_id(html, 'lblngjtot')

    # Varahi Production: https://en.wikipedia.org/wiki/Varahi_River#Varahi_Hydro-electric_Project
    varahi_value = IN.read_value_from_span_id(html, 'lblvrhtot')

    # Kodsalli Production: Kalinadi Kodasalli Hydroelectric
    kodsalli_value = IN.read_value_from_span_id(html, 'lblkdsltot')

    # Kadra Production: https://en.wikipedia.org/wiki/Kadra_Dam
    kadra_value = IN.read_value_from_span_id(html, 'lblkdrtot')

    # GERUSOPPA production: Gerusoppa Dam
    gerusoppa_value = IN.read_value_from_span_id(html, 'lblgrsptot')

    # JOG production: https://en.wikipedia.org/wiki/Jog_Falls
    jog_value = IN.read_value_from_span_id(html, 'lbljogtot')

    # LPH Production: Linganamakki Dam
    lph_value = IN.read_value_from_span_id(html, 'lbllphtot')

    # Supa production: https://en.wikipedia.org/wiki/Supa_Dam
    supa_value = IN.read_value_from_span_id(html, 'lblsupatot')

    # SHIMSHA: https://en.wikipedia.org/wiki/Shimsha#Power_generation
    shimsha_value = IN.read_value_from_span_id(html, 'lblshimtot')

    # SHIVASAMUDRA: https://en.wikipedia.org/wiki/Shivanasamudra_Falls#Power_generation
    shivasamudra_value = IN.read_value_from_span_id(html, 'lblshivtot')

    # MANIDAM: Mani Dam Hydroelectric
    manidam_value = IN.read_value_from_span_id(html, 'lblmanitot')

    # MUNRABAD: Munirabad Hydroelectric
    munrabad_value = IN.read_value_from_span_id(html, 'lblmbdtot')

    # BHADRA: https://en.wikipedia.org/wiki/Bhadra_Dam
    bhadra_value = IN.read_value_from_span_id(html, 'lblbdratot')

    # GHATAPRABHA: Ghataprabha Hydroelectric
    ghataprabha_value = IN.read_value_from_span_id(html, 'lblgtprtot')

    # ALMATTI: https://en.wikipedia.org/wiki/Almatti_Dam
    almatti_value = IN.read_value_from_span_id(html, 'lblalmttot')

    # CGS (Central Generating Stations) Production
    # TODO: Search CGS production type
    cgs_value = IN.read_value_from_span_id(html, 'lblcgs')

    # NCEP (Non-Conventional Energy Production)
    ncep_html = web.get_response_soup(country_code,
                                      'http://kptclsldc.com/StateNCEP.aspx',
                                      session)
    ncep_date_time = IN.read_datetime_from_span_id(ncep_html, 'Label1',
                                                   'DD/MM/YYYY HH:mm:ss')

    # Check ncep date is similar than state gen date
    if abs(india_date_time.timestamp - ncep_date_time.timestamp) > 600:
        raise ParserException('IN-KA', 'NCEP or State datetime is not valid')

    biomass_value = IN.read_value_from_span_id(ncep_html, 'lbl_tb')

    # TODO: Cogeneration value production type?
    cogen_value = IN.read_value_from_span_id(ncep_html, 'lbl_tc')

    mini_hydro_value = IN.read_value_from_span_id(ncep_html, 'lbl_tm')

    wind_value = IN.read_value_from_span_id(ncep_html, 'lbl_tw')

    solar_value = IN.read_value_from_span_id(ncep_html, 'lbl_ts')

    # Hydro production
    hydro_value = sharavati_value + nagjhari_value + varahi_value + kodsalli_value \
                  + kadra_value + gerusoppa_value + jog_value + lph_value + supa_value \
                  + shimsha_value + shivasamudra_value + manidam_value + munrabad_value \
                  + bhadra_value + ghataprabha_value + almatti_value + mini_hydro_value

    # Unknown production
    unknown_value = cgs_value + cogen_value

    data = {
        'countryCode': country_code,
        'datetime': india_date_time.datetime,
        'production': {
            'biomass': biomass_value,
            'coal': coal_value,
            'gas': 0.0,
            'hydro': hydro_value,
            'nuclear': 0.0,
            'oil': 0.0,
            'solar': solar_value,
            'wind': wind_value,
            'geothermal': 0.0,
            'unknown': unknown_value
        },
        'storage': {
            'hydro': 0.0
        },
        'source': 'kptclsldc.com',
    }

    return data