Python IMDbPY – Getting birth date of person

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.



filter_none

edit
close

play_arrow

link
brightness_4
code

# 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'])

chevron_right


Output :

Nawazuddin Siddiqui  1974-05-19

Another example

filter_none

edit
close

play_arrow

link
brightness_4
code

# 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'])

chevron_right


Output :

Keanu Reeves  1964-09-02

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.