Convert publishing script to pure Python (no arcpy) with no external dependencies