Reputation: 17
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 ?
Upvotes: 0
Views: 460
Reputation: 467
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"])
John
Upvotes: 1