Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Python lib to get movie, series, episode data from the Open Movie Database (OMDb) api.

Project description

omdbapi python library.

Build Status Updates Python 3 codecov

Python lib to get movie, series, episode data from the Open Movie Database (OMDb) api. Example build and distribution python projects - Pytools course.

Used The Open Movie Database api to build a python lib and distribution in pypi.

How to use?

IMPORTANT: Requires Python 3.7 or newer. To works with python 3.6 must install the versión 0.5.1.

Before, you must be request free the omdbapi api key here

Install the library, Python 3.7 or newer:

>>> pip install omdbapi

To works with python 3.6 must install the versión 0.5.1

>>> pip install omdbapi==0.5.1

import the library and get movie, passing api key and title as parameter, default return short plot:

>>> from omdbapi.movie_search import GetMovie

>>> movie = GetMovie(title='Interstellar', api_key='your api key')

Or can set full plot as parameter:

>>> movie = GetMovie(title='Interstellar', api_key='your api key', plot='full')

Get all data movie json format:

>>> movie.get_all_data()

{'Title': 'Interstellar',
 'Year': '2014',
 'Rated': 'PG-13',
 'Released': '07 Nov 2014',
 'Runtime': '169 min',
 'Genre': 'Adventure, Drama, Sci-Fi',
 'Director': 'Christopher Nolan',
 'Writer': 'Jonathan Nolan, Christopher Nolan',
 'Actors': 'Ellen Burstyn, Matthew McConaughey, Mackenzie Foy, John Lithgow',
 'Plot': "A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.",
 'Language': 'English',
 'Country': 'USA, UK, Canada',
 'Awards': 'Won 1 Oscar. Another 43 wins & 143 nominations.',
 'Poster': 'https://m.media-amazon.com/images/M/MV5BZjdkOTU3MDktN2IxOS00OGEyLWFmMjktY2FiMmZkNWIyODZiXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_SX300.jpg',
 'Ratings': [{'Source': 'Internet Movie Database', 'Value': '8.6/10'},
  {'Source': 'Rotten Tomatoes', 'Value': '72%'},
  {'Source': 'Metacritic', 'Value': '74/100'}],
 'Metascore': '74',
 'imdbRating': '8.6',
 'imdbVotes': '1,275,886',
 'imdbID': 'tt0816692',
 'Type': 'movie',
 'DVD': '31 Mar 2015',
 'BoxOffice': '$158,737,441',
 'Production': 'Paramount Pictures',
 'Website': 'http://www.InterstellarMovie.com/',
 'Response': 'True'}

Get values using keys as parameter:

>>> movie.get_data('Director', 'Actors', 'Awards', 'Plot')

{'Director': 'Christopher Nolan',
 'Actors': 'Ellen Burstyn, Matthew McConaughey, Mackenzie Foy, John Lithgow',
 'Awards': 'Won 1 Oscar. Another 43 wins & 143 nominations.',
 'Plot': "A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival."}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for omdbapi, version 0.5.4
Filename, size File type Python version Upload date Hashes
Filename, size omdbapi-0.5.4.tar.gz (18.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page