Thursday, September 25, 2025
HomeLanguagesPython IMDbPY – Getting alternate names of person

Python IMDbPY – Getting alternate names of person

In this article we will see how we can get the alternate names of the person from the person object, alternate names are basically nick names given to them or stage name i.e name by which they are called, imdb person object act similar to dictionary therefore getting image from person object is similar from getting required information from the dictionary. 
 

In order to do this we have to do the following – 
1. Get the person object with the help of id by using get_person method 
2. Get the alternate names from it using result[‘akas’] as keys 
3. Print the result 
 

Note : Output will be the link of the image i.e string data type not actual image
Below is the implementation 
 

Python3




# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# person id
code = "1596350"
 
# getting person object
actor = ia.get_person(code)
 
# printing object it prints its name
print(actor)
 
# getting alternate names
alternate = actor['akas']
 
# printing
print(alternate)


Output : 
 

Nawazuddin Siddiqui
['Nawazuddin', 'Novaz', 'Nowaz', 'Nawazuddin Siddique', 'Nawaz Uddin']

Another example 
 

Python3




# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# person id
code = "1372788"
 
# getting person object
actor = ia.get_person(code)
 
# printing object it prints its name
print(actor)
 
# getting alternate names
alternate = actor['akas']
 
# printing
print(alternate)


Output : 
 

Shahid Kapoor
['Shahid Kapur', 'Shahid']

 

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

Most Popular

Dominic
32319 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6682 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
6753 POSTS0 COMMENTS
Umr Jansen
6761 POSTS0 COMMENTS