Open audiodude opened 1 week ago
Some sample/psuedo code.
def insert_into_mongo(processed_data):
client = pymongo.connect('mongo+srv://...')
for movie in processed_data:
client.mediabridge.movies.upsert({
'title': movie[0],
'year': movie[1]
...
})
@audiodude Are we storing unmatched movies also? The current output only includes found movies. I feel like it could theoretically be worth adding them as well, but I'm assuming they wouldn't actually be used to make recommendations? So unsure if we actually need them or if I'm missing something.
Yes I think we should store unmatched movies with a wikidata_id of NULL. This will make it easier for the recommendation part to lookup movies by their netflix ID or title.
We have a Mongo DB set up here:
mongodb+srv://noisebridgeproject.audlswx.mongodb.net/
user: noisebridge password: same as sfpythonlab.com
Let's set up our
wiki_to_netflix.py
code to push the data into Mongo. We need to think about what the objects we want to put in, specifically their shape. Probably something like the CSV output, but with a key for each column name. So for this set of data:We should have: