For nested entries e.g. you want to set a type for a boundary condition, but the patch itself doesn't have an entry yet you cant immediatley execute boundaryFile["AMI_0"]["type"] = "cylcilcAMI". You must first add an empty dictionary boundaryFile["AMI_0"] = dict() and then can set its sub values.