import csv


def getcountrylist(source="worldometer"):
  """
  Gets list of all countries for which there is information
  """
  
  equivnames={}
  with open("countrynames") as fp:
    r=csv.reader(fp)
    for x in r:
      if len(x)==0 or x[0][:1]=='#': continue
      for y in x[1:]: equivnames[y]=x[0]

  countries=set()
  with open(source+".csv") as f:
    r=csv.reader(f)
    first=1
    for x in r:
      if first: first=0;continue
      countries.add(equivnames.get(x[1],x[1]))

  return sorted(list(countries))