0

I have done JSON transformation using this demo website

http://jolt-demo.appspot.com/#inception

I even got the Json spec ready

[
  {
    "operation": "shift",
    "spec": {
      "r_id": "r_id",
      "data": {
        "list": {
          "*": {
            "uid": "uid",
            "item_list": {
              "*": {
                "p_id": "p_id",
                "sku": "sku",
                "q": "q",
                "pr": "pr"
              }
            }
          }
        }
      }
    }
  }
]

I can seem to find a python package to do this, all available packages are in Java, Is there any pythonic way to do this transformation ?

1
  • It might be nearly as easy or even easier to implement this transformation by hand in Python. Commented Aug 23, 2022 at 11:54

1 Answer 1

1

Python has an apposite standard library to deal with JSON.

Here is how you can transform JSON to Python:

import json
x =  '{ "name":"John", "age":30, "city":"New York"}'
y = json.loads(x)
print(y["name"])
Output
John
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.