Python dict schema validator with type casts