Skip to main content

Hello Team,

I have a JSON attribute:

link: {"status": "OK", "results": [{"geometry": {"location_type": "RANGE_INTERPOLATED", "bounds": {"northeast": {"lat": -23.2186594, "lng": -45.9045073}, "southwest": {"lat": -23.2189106, "lng": -45.9060239}}, "viewport": {"northeast": {"lat": -23.2174360197085, "lng": -45.9039166197085}, "southwest": {"lat": -23.2201339802915, "lng": -45.9066145802915}}, "location": {"lat": -23.2186919, "lng": -45.9056747}}, "address_components": [{"long_name": "94-254", "types": ["street_number"], "short_name": "94-254"}, {"long_name": "Rua Benedito de Moura S\\u00e1", "types": ["route"], "short_name": "R. Benedito de Moura S\\u00e1"}, {"long_name": "Parque Residencial Aquarius", "types": ["sublocality_level_1", "sublocality", "political"], "short_name": "Parque Res. Aquarius"}]

My question: how can i formatte this attribute link with python?

I put the transformer JSONFlattener and works:

Thanks in Advance,

Does this help: https://docs.python.org/2/library/json.html

Another option would be to have a JSONFlattener workspace and just run that with the Python script.


From the screenshot, I can see that a JSON document has been flattened properly, but the document you pasted is incomplete, so it doesn't help to consider a concrete solution.

The JSONFragmenter could be a quick solution. Required parameters setting is different depending on the structure of the actual JSON document and your desired result. This thread might be helpful: JSON Output Not Written


Does this help: https://docs.python.org/2/library/json.html

Another option would be to have a JSONFlattener workspace and just run that with the Python script.

Thanks @Mark2AtSafe . i will check this link


@takashi Thanks a lot!


Reply