importioimportjsonimportrequestsimportpandasaspd# get text from requestdata=response.text# set column names for csv like inputcolnames=['country','colo','lat','lon','ms']# read csv from response object, separate by tab, set column namesdf=pd.read_csv(io.StringIO(data),sep="\t",names=colnames,header=None,parse_dates=True)# geojson skeletongeojson={"type":"FeatureCollection","features":[]}# go through dataframe, append entries to geojson formatfor_,rowindf.iterrows():feature={"type":"Feature","geometry":{"type":"Point","coordinates":[row['lon'],row['lat']]},"properties":{"colo":row["colo"],"ms":row['ms']}}geojson['features'].append(feature)withopen('result.geojson','w')asfp:json.dump(geojson,fp)