We have sample Python dictionary as given below, which can be modify by multiple developers in our project. What could be best way to avoid developers not to add other than given sample keys, also to avoid them to add incorrect zip entry in address of person( zip should validate through post codes then allow to add zip), etc. also there is no currency exists with 'AAA' its invalid key, also having invalid value, I think we can do it with special functions dict.add dict.key is there any other best way to do it.
people = {1: {'name': 'John', 'age': '27', 'sex': 'Male', 'Address': { 'Door': '9-8-11', 'street': 'John-street', 'city': 'NewYork', 'zip':'99705'}, 'ExchangeCurrency':{'USD':'INR'}},
2: {'name': 'Marie', 'age': '22', 'sex': 'Female', 'Address': { 'Door': '9-8-11', 'street': 'John-street', 'city': 'NewYork', 'zip': '99705'}, 'ExchangeCurrency':{'INR':'EUR'}}}
Eg of bad entry:
{1: {'name12': 'John', 'age': '27', 'sex': 'Male', 'Address': { 'Door': '9-8-11', 'street': 'John-street', 'city': 'NewYork', 'zip':'000000'}, 'ExchangeCurrency':{'AAA':'CCC'}}