'Configurable mapping file python

My company is consuming an API that will give us large JSON objects. The API response info may be in dif fields based on query parameters (it's a 3rd party aggregator so depending on where the information is coming from). I'm looking for a way to have json (or some other easily readable syntax) file describe how to map fields from the returned data to our data object. Ideally it would allow you to say something like

{
   name : apiresponse.field1.subfield | apiresponse.field2.subfield,
   field2 :  apiresponse.field2.num + apiresponse.field2.num2
}

Are there any python packages that allow you to read and run mapping files like this?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source