# co_2_1990 unit ktCO2eq


countries =[
        {
        "name": "Austria",
        "renewables_nj_id": "AT",
        "nuts_id": "AT",
        "dh_share": 0.40,
        "psh_e": 3200,
        "co_2_1990": 11079
        },
        {
        "name": "Belgium",
        "renewables_nj_id": "BE",
        "nuts_id": "BE",
        "dh_share": 0.62,
        "MRGID": 3293,
        "iso_3": "BEL",
        "co_2_1990": 23537
        },
        {
        "name": "Bulgaria",
        "renewables_nj_id": "BG",
        "nuts_id": "BG",
        "dh_share": 0.22,
        "co_2_1990": 35179
        },
        {
        "name": "Croatia",
        "renewables_nj_id": "HR",
        "nuts_id": "HR",
        "dh_share": 0.22,
        "co_2_1990": 3729
        },
        {
        "name": "Czech Rep.",
        "renewables_nj_id": "CZ",
        "nuts_id": "CZ",
        "dh_share": 0.38,
        "co_2_1990": 54585
        },
        {
        "name": "Denmark",
        "renewables_nj_id": "DK",
        "nuts_id": "DK",
        "dh_share": 0.51,
        "MRGID": 5674,
        "iso_3": "DNK",
        "co_2_1990": 24697
        },
        {
        "name": "Estonia",
        "renewables_nj_id": "EE",
        "hotmaps_id": "EE",
        "nuts_id": "EE00",
        "dh_share": 0.47,
        "co_2_1990": 29027
        },
        {
        "name": "Finland",
        "renewables_nj_id": "FI",
        "nuts_id": "FI",
        "dh_share": 0.39,
        "MRGID": 5676,
        "iso_3": "FIN",
        "psh_e": 5000,
        "co_2_1990": 16453
        },
        {
        "name": "France",
        "renewables_nj_id": "FR",
        "nuts_id": "FR",
        "dh_share": 0.50,
        "MRGID": 5677,
        "iso_3": "FRA",
        "psh_e": 9800,
        "co_2_1990": 49161
        },
        {
        "name": "Germany",
        "renewables_nj_id": "DE",
        "nuts_id": "DE",
        "dh_share": 0.59,
        "MRGID": 5669,
        "iso_3": "DEU",
        "co_2_1990": 338451
        },
        {
        "name": "Greece",
        "renewables_nj_id": "GR",
        "nuts_id": "GR",
        "hotmaps_id": "EL",
        "dh_share": 0.42,
        "psh_e": 2400,
        "co_2_1990": 40617
        },
        {
        "name": "Hungary",
        "renewables_nj_id": "HU",
        "nuts_id": "HU",
        "dh_share": 0.41,
        "co_2_1990": 17892
        },
        {
        "name": "Ireland",
        "renewables_nj_id": "IE",
        "nuts_id": "IE",
        "dh_share": 0.46,
        "MRGID": 5681,
        "iso_3": "IRL",
        "co_2_1990": 10876
        },
        {
        "name": "Italy",
        "renewables_nj_id": "IT",
        "nuts_id": "IT",
        "dh_share": 0.46,
        "co_2_1990": 10527
        },
        {
        "name": "Latvia",
        "renewables_nj_id": "LV",
        "nuts_id": "LV",
        "dh_share": 0.49,
        "co_2_1990": 6083
        },
        {
        "name": "Lithuania",
        "renewables_nj_id": "LT",
        "nuts_id": "LT",
        "dh_share": 0.68,
        "co_2_1990": 12003
        },
        {
        "name": "Luxembourg",
        "renewables_nj_id": "LU",
        "nuts_id": "LU",
        "dh_share": 0.55,
        "co_2_1990": 33,
        },
        {
        "name": "Netherlands",
        "renewables_nj_id": "NL",
        "nuts_id": "NL",
        "dh_share": 0.68,
        "MRGID": 5668,
        "iso_3": "NLD",
        "co_2_1990": 40027
        },
        {
        "name": "Norway",
        "renewables_nj_id": "NO",
        "nuts_id": "NO",
        "dh_share": 0.36,
        "MRGID": 5686,
        "iso_3": "NOR",
        "psh_e": 84000,
        "co_2_1990": 418
        },
        {
        "name": "Poland",
        "renewables_nj_id": "PL",
        "nuts_id": "PL",
        "dh_share": 0.40,
        "co_2_1990": 227279
        },
        {
        "name": "Portugal",
        "renewables_nj_id": "PT",
        "nuts_id": "PT",
        "dh_share": 0.23,
        "psh_e": 2600,
        "co_2_1990": 14355
        },
        {
        "name": "Romania",
        "renewables_nj_id": "RO",
        "nuts_id": "RO",
        "dh_share": 0.23,
        "co_2_1990": 66280
        },
        {
        "name": "Slovakia",
        "renewables_nj_id": "SK",
        "nuts_id": "SK",
        "dh_share": 0.27,
        "co_2_1990": 14700
        },
        {
        "name": "Slovenia",
        "renewables_nj_id": "SI",
        "nuts_id": "SI",
        "dh_share": 0.26,
        "co_2_1990": 6096
        },
        {
        "name": "Spain",
        "renewables_nj_id": "ES",
        "nuts_id": "ES",
        "dh_share": 0.48,
        "psh_e": 18400,
        "co_2_1990": 65575
        },
        {
        "name": "Sweden",
        "renewables_nj_id": "SE",
        "nuts_id": "SE",
        "dh_share": 0.41,
        "MRGID": 5694,
        "iso_3": "SWE",
        "psh_e": 34000,
        "co_2_1990": 7714
        },
        {
        "name": "Switzerland",
        "renewables_nj_id": "CH",
        "nuts_id": "CH",
        "dh_share": 0.70,
        "psh_e": 8400,
        "co_2_1990": 2152
        },
        {
        "name": "Great Britain",
        "renewables_nj_id": "GB",
        "nuts_id": "UK",
        "dh_share": 0.75,
        "MRGID": 5696,
        "iso_3": "GBR",
        "co_2_1990": 203116
        },
    ]
    # {
    #     "name": "Cyprus",
    #     "renewables_nj_id": "CY",
    #     "nuts_id": "CY",
    #     "dh_share": 0.14,
    # },
    # {
    #     "name": "Malta",
    #     "renewables_nj_id": "MT",
    #     "nuts_id": "MT",
    #     "dh_share": 0.43,
    # },
    # {
    #     "name": "Bosnia and Herzegovina",
    #     "renewables_nj_id": "BA",
    #     "nuts_id": "BA",
    ##     "dh_share": 0.68,
    # },
    # {
    #     "name": "Macedonia",
    #     "renewables_nj_id": "MK",
    #     "nuts_id": "MK",
    #     "dh_share": 0.68,
    # },
    # {
    #     "name": "Montenegro",
    #     "renewables_nj_id": "ME",
    #     "nuts_id": "ME",
    ##     "dh_share": 0.68,
    # },
    # {
    #     "name": "Moldova",
    #     "renewables_nj_id": "MD",
    #     "nuts_id": "MD",
    ##     "dh_share": 0.68,
    # },
    # {
    #     "name": "Serbia",
    #     "renewables_nj_id": "RS",
    #     "nuts_id": "RS",
    ##     "dh_share": 0.68,
    # },
    #
    # ]


def countries_metadata():
    return countries


def get_metadata(country_name, metadata):
    for c in countries:
        if c.get('name') == country_name:
            metadata = c.get(metadata)
        if c.get('nuts_id') == country_name:
            metadata = c.get(metadata)
            # print(metadata)
    return metadata
