Some headway with the Python script to generate SQL for Postgres. Need to work out the fiddly bit around generating categories and subcategories up front before inserting programmes.