Friday, September 26, 2025
HomeLanguagesPython IMDbPY – Retrieving art department cast from the movie object

Python IMDbPY – Retrieving art department cast from the movie object

In this article we will see how we can retrieve the art department cast that involved in the movie from the movie information, movie id is the unique id given to each movie by IMDb. We can use search_movie method to search the movies by their name but it gives many movies as they have same names therefore retrieving a movie by its id is a better option.

In order to search a movie by its id we use get_movie method.

Syntax to get art department cast list : cast = movie[‘art department’]

Here movie is the object returned by the get_movie method which act as the dictionary

Below is the implementation.




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# ID
code = "1187043"
  
# getting movie
movie = ia.get_movie(code)
  
# printing movie object
print(movie)
  
print("===============")
  
# getting cast
cast = movie['art department']
  
# actor name from caste
actor = cast[1]
  
print(actor)


Output :

3 Idiots
===============
Ajay Chodanker

Another example :




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# ID
code = "4434004"
  
# getting movie
movie = ia.get_movie(code)
  
# printing movie object
print(movie)
  
print("===============")
  
# getting cast
cast = movie['art department']
  
# printing actors name from caste
print(cast[0])


Output :

Udta Punjab
===============
Pallavi Pethkar
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32320 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6683 POSTS0 COMMENTS
Nicole Veronica
11854 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11910 POSTS0 COMMENTS
Shaida Kate Naidoo
6795 POSTS0 COMMENTS
Ted Musemwa
7071 POSTS0 COMMENTS
Thapelo Manthata
6756 POSTS0 COMMENTS
Umr Jansen
6762 POSTS0 COMMENTS