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.
Python3
| # importing the moduleimportimdb # creating instance of IMDbia =imdb.IMDb() # person idperson_id ="1596350" # getting person detailssearch =ia.get_person(person_id)# printing the search # printing name and birth dateprint(search['name'] +"  " +search['birth date']) | 
Output :
Nawazuddin Siddiqui 1974-05-19
Time complexity of the code is O(1) as it involves only a single operation which is accessing the details of the person from the IMDb object.
Space complexity of the code is O(1) as it does not require any additional memory to store the search results.
Another example
Python3
| # importing the moduleimportimdb # creating instance of IMDbia =imdb.IMDb() # person idperson_id ="0000206" # getting person detailssearch =ia.get_person(person_id)# printing the search # printing name and birth dateprint(search['name'] +"  " +search['birth date']) | 
Output :
Keanu Reeves 1964-09-02
 
				 
					


