The best way to parse a large and running Json file with OpenRefine (or R)

I know how to parse json cells in Open to clarify, but this is too complicated for me.

enter image description here

I used the API to retrieve the calendar of 4730 AirBNB rooms identified by their identifiers.

Here is an example of a single Json file: https://fr.airbnb.com/api/v2/calendar_months?key=d306zoyjsyarp7ifhu67rjxn52tv0t20ยคcy=EUR&locale=fr&listing_id=4212133&month=11&year=2016&count=w_form

For each identifier and every day of the year from now until November 2017, I would like to get the availability of these rooms (true or false) and its price on that day.

enter image description here

I cannot figure out how to parse this data. I assume this implies a series of nested forEach, but I cannot find the right way to do this with Open Refine.

I tried of course

forEach(value.parseJson().calendar_months, e, e.days) 

The result is an array of data arrays that violate me.

Any help would be appreciated. If the operation is too complicated in Open Refine, a solution with R (or Python) would also be good for me.

+4
source share
2 answers

I think you're on the right track. Conclusion:

forEach(value.parseJson().calendar_months, e, e.days) 

, OpenRefine JSON . , , OR, ( ). OR JSON - .

, :

forEach(value.parseJson().calendar_months,m,m.days).join("|")

'join', OR OR - .

" โ†’ " - 12 , JSON. ID 12 OR

:

forEach(value.parseJson(),d,d).join("|")

JSON

" โ†’ ", .

JSON URL- - 441 ID - JSON, . "" "", .

JSON , ,

value.parseJson().available

.

+1

, GREL ...

- JSON, , JSON XML ( URL-, JSON, ). ( , : https://www.youtube.com/watch?v=vUxdB-nl0Bw)

  • JSON, , ( , , OpenRefine ) enter image description here

  • , , . enter image description here

  • " " "". , , , JSON, , , , .. , , Date, . , OpenRefine , , Row.

, Wiki

+1

Source: https://habr.com/ru/post/1661421/