Ok, this is another try I came up with. Three of the movies have not been released or production has not started
With all the queries, it takes a minute to get results
First it test for a year in the original call, if year is None, it test from a movie call using the movieID. If there is a KeyError, set a default value. I checked the production date of the three with no year. They are not in production or may not be produced.
With all the queries, it takes a minute to get results
First it test for a year in the original call, if year is None, it test from a movie call using the movieID. If there is a KeyError, set a default value. I checked the production date of the three with no year. They are not in production or may not be produced.
from imdb import Cinemagoer from pandas import DataFrame from tabulate import tabulate ia = Cinemagoer() arg = 'angelina jolie' people = ia.search_person(arg) person = people[0] person = ia.get_person(person.personID) jobs = [job for job in person['filmography'].keys()] movies = [movie for movie in person['filmography'][jobs[0]]] data = [] for stuff in movies: if stuff.get('year') != None: year = stuff.get('year') else: if ia.get_movie(stuff.movieID).get('year'): year = ia.get_movie(stuff.movieID).get('year') else: year = 'No Release Date Available' data.append((stuff.get('title'), str(year), stuff.movieID)) data.sort(key=lambda date: date[1]) headers = ['Movie', 'Release', 'Movie ID'] show = tabulate(DataFrame(data), headers=headers, tablefmt='pretty', showindex=False, colalign=('left', 'left', 'left')) print(show)output
Output:+----------------------------------------------+---------------------------+----------+
| Movie | Release | Movie ID |
+----------------------------------------------+---------------------------+----------+
| Lookin' to Get Out | 1982 | 0084268 |
| Antonello Venditti: Alta marea | 1990 | 7307196 |
| Lenny Kravitz: Stand by My Woman | 1991 | 9145838 |
| Alice & Viril | 1993 | 0356342 |
| Angela & Viril | 1993 | 0356360 |
| The Lemonheads: It's About Time | 1993 | 9145946 |
| Widespread Panic: Wonderin' | 1993 | 13381208 |
| Cyborg 2: Glass Shadow | 1993 | 0106639 |
| Meat Loaf: Bat Out of Hell II - Picture Show | 1994 | 0364980 |
| Meat Loaf: Rock and Roll Dreams Come Through | 1994 | 7023152 |
| Without Evidence | 1995 | 0176326 |
| Hackers | 1995 | 0113243 |
| Mojave Moon | 1996 | 0117070 |
| Foxfire | 1996 | 0116353 |
| Love Is All There Is | 1996 | 0116928 |
| Playing God | 1997 | 0119906 |
| The Rolling Stones: Anybody Seen My Baby? | 1997 | 6762286 |
| George Wallace | 1997 | 0119189 |
| True Women | 1997 | 0118499 |
| Playing by Heart | 1998 | 0145734 |
| Hell's Kitchen | 1998 | 0129136 |
| Gia | 1998 | 0123865 |
| Girl, Interrupted | 1999 | 0172493 |
| The Bone Collector | 1999 | 0145681 |
| Pushing Tin | 1999 | 0120797 |
| Gone in 60 Seconds | 2000 | 0187078 |
| Billy Bob Thornton: Angelina | 2001 | 13381238 |
| Original Sin | 2001 | 0218922 |
| Lara Croft: Tomb Raider | 2001 | 0146316 |
| Life or Something Like It | 2002 | 0282687 |
| Beyond Borders | 2003 | 0294357 |
| Korn: Did My Time | 2003 | 8661174 |
| Lara Croft: Tomb Raider - The Cradle of Life | 2003 | 0325703 |
| Alexander | 2004 | 0346491 |
| The Fever | 2004 | 0368725 |
| Shark Tale | 2004 | 0307453 |
| Sky Captain and the World of Tomorrow | 2004 | 0346156 |
| Taking Lives | 2004 | 0364045 |
| Mr. & Mrs. Smith | 2005 | 0356910 |
| The Good Shepherd | 2006 | 0343737 |
| Stars in Their Eyes Kids | 2006 | 0363377 |
| Beowulf | 2007 | 0442933 |
| Entourage | 2007 | 0387199 |
| A Mighty Heart | 2007 | 0829459 |
| Wanted | 2008 | 0493464 |
| Changeling | 2008 | 0824747 |
| Kung Fu Panda | 2008 | 0441773 |
| The Tourist | 2010 | 1243957 |
| Kung Fu Panda Holiday | 2010 | 1702433 |
| Salt | 2010 | 0944835 |
| Kung Fu Panda: Secrets of the Masters | 2011 | 1980162 |
| Kung Fu Panda 2 | 2011 | 1302011 |
| Kung Fu Panda Po's Winter Wonderland | 2012 | 21360350 |
| Maleficent | 2014 | 1587310 |
| By the Sea | 2015 | 3707106 |
| Kung Fu Panda 3 | 2016 | 2267968 |
| Mon Guerlain: Notes of a Woman | 2017 | 9110568 |
| Maleficent: Mistress of Evil | 2019 | 4777008 |
| The One and Only Ivan | 2020 | 3661394 |
| Come Away | 2020 | 5714470 |
| Eternals | 2021 | 9032400 |
| Those Who Wish Me Dead | 2021 | 3215824 |
| Kung Fu Panda 4 | 2024 | 21692408 |
| Every Note Played | No Release Date Available | 11351272 |
| Maleficent 3 | No Release Date Available | 15410560 |
| Maria | No Release Date Available | 22893404 |
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags