Subscribe RSS feeds for IMDbPY.
Documentation
These are some of the documents for the current stable (4.3) IMDbPY release.
| File | Description |
|---|---|
| README.txt | A short introduction to IMDbPY, its features and instructions to install it (with notes for packagers). |
| README.newparsers | Notes about the new parsers introduced with IMDbPY 3.7. |
| README.mobile | Instructions and tips to use IMDbPY in systems with limited CPU power and bandwidth. |
| README.sqldb | How to put the whole IMDb's database in a SQL database. |
| README.info2xml | How to use export information in XML format. |
| README.locale | How to use localize the tags used in the XML format. |
| README.keywords | How to search and manage keywords. |
| README.package | How to use the IMDbPY package in your programs. |
| README.devel | Basic instructions to develop and extend IMDbPY. |
| README.adult | Notes for sensitive people. |
| README.users | Notes about the example scripts. |
| README.series | Notes about tv series' episodes support. |
| README.utf8 | Notes for developers, about the unicode support. |
| README.currentRole | Notes about the support for characters. |
| README.companies | Notes about the support for companies. |
| DISCLAIMER.txt | Disclaimer. |
| TODO.txt | Things to do. |
Examples
As said, IMDbPY is mostly useful to build new applications like these. Anyway, here is a short example of how you can use it directly from the Python interpreter or in your program:
# Import the imdb package.
import imdb
# Create the object that will be used to access the IMDb's database.
ia = imdb.IMDb() # by default access the web.
# Search for a movie (get a list of Movie objects).
s_result = ia.search_movie('The Untouchables')
# Print the long imdb canonical title and movieID of the results.
for item in s_result:
print item['long imdb canonical title'], item.movieID
# Retrieves default information for the first result (a Movie object).
the_unt = s_result[0]
ia.update(the_unt)
# Print some information.
print the_unt['runtime']
print the_unt['rating']
director = the_unt['director'] # get a list of Person objects.
# Get the first item listed as a "goof".
ia.update(the_unt, 'goofs')
print the_unt['goofs'][0]
# The first "trivia" for the first director.
b_depalma = director[0]
ia.update(b_depalma)
print b_depalma['trivia'][0]
|