-1

I'm currently doing a system that scrap data from foursquare. Right now i have scrap the review from the website using python and beautiful soup and have a json file like below

{"review": "From sunset too variety food u cant liked it.."}{"review": "Byk motor laju2"}{"review": "Good place to chill"}{"review": "If you wan to play bubble and take photo, here is the best place"}{"review": "Scenic view for weekend getaway... coconut shake not taste as original klebang coconut shake..."}{"review": "Getting dirtier"}{"review": "Weekend getaway!"}{"review": "Good for casual walk & watching sunset with loved ones since my last visit macam2 ade kat sini very packed during public holidays"}{"review": "Afternoon time quite dry..beach is normal. Maybe evening/night might be better. The coconut shake they add vanilla ice cream,hmmm"}{"review": "Pantai awesome beb"}{"review": "Nice place for picnic"}{"review": "Cannot mandi here. Good place for recreation.. Calm place for weekdays! Haha"}{"review": "Very bz place. Need to go there early if you want to lepak. If not, no parking for you"}{"review": "So many good attraction here, worth a visit"}{"review": "Beautiful place for sunset"}{"review": "New beach!  Like all beaches, awesome view & windy.  Some stretch got many small crabs."}{"review": "There is bustel \"hotel in a bus\" can get coconut shake or fried seafood in the evening at 5pm. Bustel rate is from RM80. Bus cafe, bus toilet... Total bus transformation"}{"review": "Too crowded la"}{"review": "Muzium kapal selam closed since 1/3 until further notice..\ud83d\ude29"}{"review": "If you are looking for public toilets, look for a red bus. An old bus was modified and transformed to operate as toilets. Cool."}{"review": "Most of the shops closed after 12 midnight..helloo,this place should be the place for the late nighters..late night supposed to be the peak hour for business..live band bar maybe?? :-P"}

My question is how do i insert the data into a database right away? Is MYSQL can be use, or should i go with PyMongo instead.

ali
  • 859
  • 4
  • 12
  • 25
  • You can use _any_ database for this. Which one you choose depends on things like what systems you're already familiar, what systems the project already uses (if any), what other requirements the project might have, etc... –  Jan 14 '18 at 18:50
  • Pymongo is a Python package that implies you will use MongoDB as a database. –  Jan 18 '18 at 11:26

2 Answers2

1

It depends on your usages. Basically, MongoDB is suitable for JSON document so, you will be able to insert your Python object "directly". If you want/need to use MySQL, you will probably need to perform some transformations before inserting. Check this post for more information: Inserting JSON into MySQL using Python

0

You can convert your json into a string (json.dumps()) and store in a character field.

Or, Django has support for JSONField when using Postgres (docs), this has some additional features like querying inside the json

at14
  • 1,194
  • 9
  • 16