Ratings & watchlist

Import the ratings:


In [1]:
import csv
from datetime import datetime


class Record:
    def __init__(self, date, title, year, rating5, rating10, imdb_url):
        self.date = datetime.strptime(date, '%Y-%m-%d')
        self.title = title
        self.year = int(year)
        self.rating5 = int(rating5) if rating5.isdigit() else None
        self.rating10 = int(rating10) if rating10.isdigit() else None
        self.imdb_url = imdb_url
    
    def __str__(self):
        return '{} ({})'.format(self.title, self.year)


with open('ratings.csv', newline='') as f:
    records = list(map(lambda r: Record(*r), list(csv.reader(f))[1:]))

Most recently watched movies:


In [2]:
for record in list(sorted(records, key=lambda r: r.date, reverse=True))[:10]:
    print('{}, {}, {}/5'.format(record.date.strftime('%a %b %d %Y'), record, record.rating5))


Tue Apr 30 2019, Black Panther (2018), 4/5
Tue Apr 09 2019, Avengers: Infinity War (2018), 4/5
Sun Mar 24 2019, Guardians of the Galaxy Vol. 2 (2017), 4/5
Sat Mar 23 2019, Spider-Man: Homecoming (2017), 4/5
Sat Mar 16 2019, Doctor Strange (2016), 4/5
Fri Feb 08 2019, No Country for Old Men (2007), 2/5
Sat Dec 22 2018, Don Jon (2013), 2/5
Sat Dec 01 2018, Three Billboards Outside Ebbing, Missouri (2017), 2/5
Sat Oct 27 2018, It (2017), 2/5
Tue Aug 07 2018, Den blomstertid nu kommer (2018), 5/5

Top rated movies:


In [3]:
for record in sorted(filter(lambda r: r.rating5 >= 5, records), key=lambda r: r.rating5, reverse=True):
    print('{}/5, {}'.format(record.rating5, record))


5/5, Den blomstertid nu kommer (2018)
5/5, A Quiet Place (2018)
5/5, Undeserved (2016)
5/5, Sacred Vow (2016)
5/5, War Room (2015)
5/5, Courageous (2011)
5/5, I'm Not Ashamed (2016)
5/5, The Lord of the Rings: The Return of the King (2003)
5/5, The Lord of the Rings: The Two Towers (2002)
5/5, The Lord of the Rings: The Fellowship of the Ring (2001)
5/5, Miracles from Heaven (2016)
5/5, The Case for Christ (2017)
5/5, Fireproof (2008)
5/5, Evolution's Achilles' Heels (2014)
5/5, Baby Driver (2017)
5/5, Hacksaw Ridge (2016)
5/5, Into the White (2012)
5/5, The Big Short (2015)
5/5, Rogue One (2016)
5/5, The Good, the Bad and the Ugly (1966)
5/5, The Hateful Eight (2015)
5/5, Another Earth (2011)
5/5, Kingsman: The Secret Service (2014)
5/5, Star Wars: The Force Awakens (2015)
5/5, Forrest Gump (1994)
5/5, Brooklyn (2015)
5/5, Kill Bill: Vol. 2 (2004)
5/5, Kill Bill: Vol. 1 (2003)
5/5, Inside Out (2015)
5/5, Interstellar (2014)
5/5, Whiplash (2014)
5/5, Drive (2011)
5/5, The Reunion (2013)
5/5, Nightcrawler (2014)
5/5, Fury (2014)
5/5, Chef (2014)
5/5, Predestination (2014)
5/5, Black Mirror (2011)
5/5, Gone Girl (2014)
5/5, Dredd (2012)
5/5, Edge of Tomorrow (2014)
5/5, Easy Money (2010)
5/5, Princess Mononoke (1997)
5/5, Gravity (2013)
5/5, The Social Network (2010)
5/5, Fight Club (1999)
5/5, Inception (2010)
5/5, Firefly (2002)
5/5, Cloud Atlas (2012)
5/5, Twelve Monkeys (1995)
5/5, Ghost in the Shell (1995)