0

I was wondering if someone could help me get a list of all the actor's actress's filmography from a single show?

full_cast = ia.get_movie('0203259', 'full credits')
full_cast = full_cast['cast']
full_cast

I can get the filmography of one person using:

ice_t=i.get_person('0001384')
for job in ice_t['filmography'].keys():
    print('# Job:', job)
    for movie in ice_t['filmography'][job]:
        print('\t t%s %s (role: %s)' % (movie.movieID, movie['title'], movie.currentRole))

but I don't know how to apply the function above to full_cast. Can someone help?

tangerine7199
  • 443
  • 2
  • 8
  • 24
  • I don't know what `full_cast` returns, but if it returns something that includes the person ID number, it's clearly just `for person in full_cast:` / `per = i.get_person(person.id)` or whatever. Right? Just a nested loop. – Tim Roberts Apr 09 '21 at 19:49
  • full_cast returns a list of 7K people with their ID but I'm afraid I can't follow what you're saying. – tangerine7199 Apr 12 '21 at 15:16

1 Answers1

0

I think you should have been able to figure this out from the documentation.

for person in full_cast:
    print(person['name'])
    for movie in person['filmography'].values():
        print('\t t%s %s (role: %s)' % (movie.movieID, movie['title'], movie.currentRole))
Tim Roberts
  • 48,973
  • 4
  • 21
  • 30
  • i thank you so very much for your help. I'm very new to Python so this isn't as intuitive as it may be for others. I ran from imdb.Person import Person for person in full_cast: print(person['name']) for movie in person['filmography'].values(): print('\t t%s %s (role: %s)' % (movie.movieID, movie['title'], movie.currentRole)) And I got a Key Error: filmography – tangerine7199 Apr 13 '21 at 02:15