|
from csv import DictReader |
|
|
|
PATH = "src/electricity_mix.csv" |
|
COUNTRY_CODES = [ |
|
("๐ World", "WOR"), |
|
("๐ช๐บ Europe", "EEE"), |
|
("๐ฟ๐ผ Zimbabwe", "ZWE"), |
|
("๐ฟ๐ฒ Zambia", "ZMB"), |
|
("๐ฟ๐ฆ South Africa", "ZAF"), |
|
("๐พ๐ช Yemen", "YEM"), |
|
("๐ป๐ณ Vietnam", "VNM"), |
|
("๐ป๐ช Venezuela", "VEN"), |
|
("๐บ๐ฟ Uzbekistan", "UZB"), |
|
("๐บ๐พ Uruguay", "URY"), |
|
("๐บ๐ธ United States", "USA"), |
|
("๐บ๐ฆ Ukraine", "UKR"), |
|
("๐น๐ฟ Tanzania", "TZA"), |
|
("๐น๐ผ Taiwan", "TWN"), |
|
("๐น๐น Trinidad and Tobago", "TTO"), |
|
("๐น๐ท Turkey", "TUR"), |
|
("๐น๐ณ Tunisia", "TUN"), |
|
("๐น๐ฒ Turkmenistan", "TKM"), |
|
("๐น๐ฏ Tajikistan", "TJK"), |
|
("๐น๐ญ Thailand", "THA"), |
|
("๐น๐ฌ Togo", "TGO"), |
|
("๐ธ๐พ Syrian Arab Republic", "SYR"), |
|
("๐ธ๐ป El Salvador", "SLV"), |
|
("๐ธ๐ณ Senegal", "SEN"), |
|
("๐ธ๐ฐ Slovak Republic", "SVK"), |
|
("๐ธ๐ฎ Slovenia", "SVN"), |
|
("๐ธ๐ฌ Singapore", "SGP"), |
|
("๐ธ๐ช Sweden", "SWE"), |
|
("๐ธ๐ฉ Sudan", "SDN"), |
|
("๐ธ๐ฆ Saudi Arabia", "SAU"), |
|
("๐ท๐บ Russian Federation", "RUS"), |
|
("๐ท๐ธ Serbia and Montenegro", "SCG"), |
|
("๐ท๐ด Romania", "ROU"), |
|
("๐ถ๐ฆ Qatar", "QAT"), |
|
("๐ต๐พ Paraguay", "PRY"), |
|
("๐ต๐น Portugal", "PRT"), |
|
("๐ต๐ฑ Poland", "POL"), |
|
("๐ต๐ฐ Pakistan", "PAK"), |
|
("๐ต๐ญ Philippines", "PHL"), |
|
("๐ต๐ช Peru", "PER"), |
|
("๐ต๐ฆ Panama", "PAN"), |
|
("๐ด๐ฒ Oman", "OMN"), |
|
("๐ณ๐ฟ New Zealand", "NZL"), |
|
("๐ณ๐ต Nepal", "NPL"), |
|
("๐ณ๐ด Norway", "NOR"), |
|
("๐ณ๐ฑ Netherlands", "NLD"), |
|
("๐ณ๐ฎ Nicaragua", "NIC"), |
|
("๐ณ๐ฌ Nigeria", "NGA"), |
|
("๐ณ๐ฆ Namibia", "NAM"), |
|
("๐ฒ๐ฟ Mozambique", "MOZ"), |
|
("๐ฒ๐พ Malaysia", "MYS"), |
|
("๐ฒ๐ฝ Mexico", "MEX"), |
|
("๐ฒ๐น Malta", "MLT"), |
|
("๐ฒ๐ณ Mongolia", "MNG"), |
|
("๐ฒ๐ฒ Myanmar", "MMR"), |
|
("๐ฒ๐ฐ North Macedonia", "MKD"), |
|
("๐ฒ๐ฉ Moldova", "MDA"), |
|
("๐ฒ๐ฆ Morocco", "MAR"), |
|
("๐ฑ๐พ Libya", "LBY"), |
|
("๐ฑ๐ป Latvia", "LVA"), |
|
("๐ฑ๐บ Luxembourg", "LUX"), |
|
("๐ฑ๐น Lithuania", "LTU"), |
|
("๐ฑ๐ฐ Sri Lanka", "LKA"), |
|
("๐ฑ๐ง Lebanon", "LBN"), |
|
("๐ฐ๐ฟ Kazakhstan", "KAZ"), |
|
("๐ฐ๐ผ Kuwait", "KWT"), |
|
("๐ฐ๐ท South Korea", "KOR"), |
|
("๐ฐ๐ต North Korea", "PRK"), |
|
("๐ฐ๐ญ Cambodia", "KHM"), |
|
("๐ฐ๐ฌ Kyrgyz Republic", "KGZ"), |
|
("๐ฐ๐ช Kenya", "KEN"), |
|
("๐ฏ๐ต Japan", "JPN"), |
|
("๐ฏ๐ด Jordan", "JOR"), |
|
("๐ฏ๐ฒ Jamaica", "JAM"), |
|
("๐ฎ๐น Italy", "ITA"), |
|
("๐ฎ๐ธ Iceland", "ISL"), |
|
("๐ฎ๐ท Iran", "IRN"), |
|
("๐ฎ๐ถ Iraq", "IRQ"), |
|
("๐ฎ๐ณ India", "IND"), |
|
("๐ฎ๐ฑ Israel", "ISR"), |
|
("๐ฎ๐ช Ireland", "IRL"), |
|
("๐ฎ๐ฉ Indonesia", "IDN"), |
|
("๐ญ๐บ Hungary", "HUN"), |
|
("๐ญ๐น Haiti", "HTI"), |
|
("๐ญ๐ท Croatia", "HRV"), |
|
("๐ญ๐ณ Honduras", "HND"), |
|
("๐ญ๐ฐ Hong Kong", "HKG"), |
|
("๐ฌ๐น Guatemala", "GTM"), |
|
("๐ฌ๐ท Greece", "GRC"), |
|
("๐ฌ๐ฎ Gibraltar", "GIB"), |
|
("๐ฌ๐ญ Ghana", "GHA"), |
|
("๐ฌ๐ช Georgia", "GEO"), |
|
("๐ฌ๐ง United Kingdom", "GBR"), |
|
("๐ฌ๐ฆ Gabon", "GAB"), |
|
("๐ซ๐ท France", "FRA"), |
|
("๐ซ๐ฎ Finland", "FIN"), |
|
("๐ช๐น Ethiopia", "ETH"), |
|
("๐ช๐ธ Spain", "ESP"), |
|
("๐ช๐ท Eritrea", "ERI"), |
|
("๐ช๐ฌ Egypt", "EGY"), |
|
("๐ช๐ช Estonia", "EST"), |
|
("๐ช๐จ Ecuador", "ECU"), |
|
("๐ฉ๐ฟ Algeria", "DZA"), |
|
("๐ฉ๐ด Dominican Republic", "DOM"), |
|
("๐ฉ๐ฐ Denmark", "DNK"), |
|
("๐ฉ๐ช Germany", "DEU"), |
|
("๐จ๐ฟ Czech Republic", "CZE"), |
|
("๐จ๐พ Cyprus", "CYP"), |
|
("๐จ๐บ Cuba", "CUB"), |
|
("๐จ๐ท Costa Rica", "CRI"), |
|
("๐จ๐ด Colombia", "COL"), |
|
("๐จ๐ณ China", "CHN"), |
|
("๐จ๐ฒ Cameroon", "CMR"), |
|
("๐จ๐ฑ Chile", "CHL"), |
|
("๐จ๐ฎ Cote d'Ivoire", "CIV"), |
|
("๐จ๐ญ Switzerland", "CHE"), |
|
("๐จ๐ฌ Congo", "COG"), |
|
("๐จ๐ฉ Democratic Republic of the Congo", "COD"), |
|
("๐จ๐ฆ Canada", "CAN"), |
|
("๐ง๐พ Belarus", "BLR"), |
|
("๐ง๐ผ Botswana", "BWA"), |
|
("๐ง๐ท Brazil", "BRA"), |
|
("๐ง๐ด Bolivia", "BOL"), |
|
("๐ง๐ณ Brunei", "BRN"), |
|
("๐ง๐ฏ Benin", "BEN"), |
|
("๐ง๐ญ Bahrain", "BHR"), |
|
("๐ง๐ฌ Bulgaria", "BGR"), |
|
("๐ง๐ช Belgium", "BEL"), |
|
("๐ง๐ฉ Bangladesh", "BGD"), |
|
("๐ง๐ฆ Bosnia and Herzegovina", "BIH"), |
|
("๐ฆ๐ฟ Azerbaijan", "AZE"), |
|
("๐ฆ๐บ Australia", "AUS"), |
|
("๐ฆ๐น Austria", "AUT"), |
|
("๐ฆ๐ท Argentina", "ARG"), |
|
("๐ฆ๐ด Angola", "AGO"), |
|
("๐ฆ Netherlands Antilles", "ANT"), |
|
("๐ฆ๐ฒ Armenia", "ARM"), |
|
("๐ฆ๐ฑ Albania", "ALB"), |
|
("๐ฆ๐ช United Arab Emirates", "ARE") |
|
] |
|
|
|
|
|
def find_electricity_mix(code: str): |
|
|
|
|
|
res = [] |
|
with open(PATH) as fd: |
|
csv = DictReader(fd) |
|
for row in csv: |
|
res += [float(row[code])] |
|
return res |
|
|