#!/usr/bin/env python3 import json from georgedata import the data = [{"name":k,"link":v[0],"colour":v[1],"is_council":v[2] if len(v)>2 else False} for k,v in the.items()] print("Content-Type: application/json") print("Comedy: extreme") print() print(json.dumps(data))