Do you think guessing is the best strategy?
Most object keep their instance variables in a dictionary named dict. Let's see what keys are in the __dict__.
from imdb import Cinemagoer
ia = Cinemagoer()
search = ia.get_movie('0133093') # The Matrix
print(*search.__dict__)
Output:
data myID notes titlesRefs namesRefs charactersRefs modFunct current_info infoset2keys key2infoset _Container__role movieID myTitle accessSystem keys_tomodify _roleIsPerson _roleClass
Nothing all that promising there. Those attributes must reference some sort of collection. "data" looks promising.
from imdb import Cinemagoer
ia = Cinemagoer()
search = ia.get_movie('0133093') # The Matrix
print(type(search.data))
Output:
<class 'dict'>
data is a dict. Lets look at the keys.
from imdb import Cinemagoer
ia = Cinemagoer()
search = ia.get_movie('0133093') # The Matrix
print(search.data.keys())
Output:
dict_keys(['localized title', 'cast', 'genres', 'runtimes', 'countries', 'country codes', 'language codes', 'color info', 'aspect ratio', 'sound mix', 'box office', 'certificates', 'original air date', 'rating', 'votes', 'cover url', 'imdbID', 'videos', 'plot outline', 'languages', 'title', 'year', 'kind', 'original title', 'director', 'writer', 'producer', 'composer', 'cinematographer', 'editor', 'editorial department', 'casting director', 'production design', 'art direction', 'set decoration', 'costume designer', 'make up', 'production manager', 'assistant director', 'art department', 'sound crew', 'special effects', 'visual effects', 'stunt performer', 'camera and electrical department', 'animation department', 'casting department', 'costume department', 'location management', 'music department', 'script department', 'transportation department', 'miscellaneous crew', 'akas', 'top 250 rank', 'production companies', 'distributors', 'special effects companies', 'other companies', 'plot', 'synopsis'])
"original air date" looks interesting.
from imdb import Cinemagoer
ia = Cinemagoer()
search = ia.get_movie('0133093') # The Matrix
print(search.data['original air date'])
Output:
31 Mar 1999 (USA)
Snooping around in the other fields may reveal more information. You'll have to snoop around.
The best way to snoop is to use interactive python.
Output:
(env) > python
Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from imdb import Cinemagoer
>>> info = Cinemagoer().get_movie('0133093')
>>> dir(info)
['_Container__role', '__bool__', '__class__', '__contains__', '__deepcopy__', '__delattr__', '__delitem__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_additional_keys', '_clear', '_getSeriesTitle', '_get_currentRole', '_get_roleID', '_getitem', '_image_key', '_init', '_reset', '_roleClass', '_roleIsPerson', '_set_currentRole', '_set_roleID', 'accessSystem', 'add_to_current_info', 'append_item', 'asXML', 'charactersRefs', 'clear', 'cmpFunct', 'copy', 'currentRole', 'current_info', 'data', 'default_info', 'get', 'getAsXML', 'getID', 'get_charactersRefs', 'get_current_info', 'get_fullsizeURL', 'get_namesRefs', 'get_titlesRefs', 'guessLanguage', 'has_current_info', 'has_key', 'infoset2keys', 'isSame', 'isSameMovie', 'isSameTitle', 'items', 'iteritems', 'iterkeys', 'itervalues', 'key2infoset', 'keys', 'keys_alias', 'keys_tomodify', 'keys_tomodify_list', 'modFunct', 'movieID', 'myID', 'myTitle', 'namesRefs', 'notes', 'pop', 'popitem', 'reset', 'roleID', 'set_current_info', 'set_data', 'set_item', 'set_mod_funct', 'set_title', 'setdefault', 'smartCanonicalTitle', 'summary', 'titlesRefs', 'update', 'update_charactersRefs', 'update_infoset_map', 'update_namesRefs', 'update_titlesRefs', 'values']
>>> data = info.data
>>> data.keys()
dict_keys(['localized title', 'cast', 'genres', 'runtimes', 'countries', 'country codes', 'language codes', 'color info', 'aspect ratio', 'sound mix', 'box office', 'certificates', 'original air date', 'rating', 'votes', 'cover url', 'imdbID', 'videos', 'plot outline', 'languages', 'title', 'year', 'kind', 'original title', 'director', 'writer', 'producer', 'composer', 'cinematographer', 'editor', 'editorial department', 'casting director', 'production design', 'art direction', 'set decoration', 'costume designer', 'make up', 'production manager', 'assistant director', 'art department', 'sound crew', 'special effects', 'visual effects', 'stunt performer', 'camera and electrical department', 'animation department', 'casting department', 'costume department', 'location management', 'music department', 'script department', 'transportation department', 'miscellaneous crew', 'akas', 'top 250 rank', 'production companies', 'distributors', 'special effects companies', 'other companies', 'plot', 'synopsis'])
>>> data["title"]
'The Matrix'