Skip to content
Advertisement

Python: Change a JSON value

Let’s say I have the following JSON file named output.

JavaScript

If type key has a value datetimeoffset, I would like to change it to dateTime and if If type key has a value Int32, I would like to change it to integer and like this, I have multiple values to replace.

The expected output is

JavaScript

Can anyone help with this in Python?

Advertisement

Answer

You can try this out:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement