Skip to content
Related Articles

Related Articles

Python IMDbPY – Getting birth date of person

View Discussion
Improve Article
Save Article
  • Last Updated : 22 Apr, 2020
View Discussion
Improve Article
Save Article

In this article we will see how we get the birth date of any person, we can get retrieve the person data with the help of get_person method by passing the person id.

get_person method returns a imdb Person object which can be used as a dictionary i.e. they can be queried by giving the key of the data, here key will be birth date.

Syntax : person[‘birth date’]
Here person is the Person object return by the get_person method.

Return : It return string which is birth date.

Below is the implementation.




# importing the module
import imdb
   
# creating instance of IMDb
ia = imdb.IMDb()
   
# person id
person_id = "1596350"
   
# getting person details
search = ia.get_person(person_id)
  
# printing the search 
# printing name and birth date
print(search['name'] + "  " +search['birth date'])

Output :

Nawazuddin Siddiqui  1974-05-19

Another example




# importing the module
import imdb
   
# creating instance of IMDb
ia = imdb.IMDb()
   
# person id
person_id = "0000206"
   
# getting person details
search = ia.get_person(person_id)
  
# printing the search 
# printing name and birth date
print(search['name'] + "  " +search['birth date'])

Output :

Keanu Reeves  1964-09-02

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!