Skip to main content

A Python service for querying IMDb data

Project description

Build and Publish to PyPI

imdbinfo

A Python package to fetch and manage IMDb movie information easily.

Requirements

Python (3.7 or higher)

Installation

pip install imdbinfo

Usage

from imdbinfo.services import search_title, get_movie

# Search for a movie by title
results = search_title("The Matrix")
for movie in results.titles:
    print(f"{movie.title} ({movie.year}) - {movie.imdb_id}")

Will output:

Matrix (1999) - 0133093
Matrix Reloaded (2003) - 0234215
Matrix Resurrections (2021) - 10838180
Matrix Revolutions (2003) - 0242653
The Matrix Recalibrated (2004) - 0410519

Dump the search results in JSON format, to see the full details of the search results:

print(results.model_dump_json())

Get detailed information about a movie by IMDb ID

# Get detailed information about a movie by IMDb ID
movie = get_movie("0133093") 
print(f"Title: {movie.title}") # Title: The Matrix
print(f"Year: {movie.year}") # Year: 1999
print(f"Rating: {movie.rating}") # Rating: 8.7
print(f"Genres: {', '.join(movie.genres)}") # Genres: Action, Sci-Fi
print(f"Plot: {movie.plot}") # Plot: A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.

Dump the movie details in JSON format:

print(movie.model_dump_json())

NEW FEATURES

Under MovieDetail.categories dictionary, you can find various categories of people involved in the movie production. The categories include:

  • director
  • writer
  • cast
  • producer
  • composer
  • cinematographer
  • editor
  • casting_director
  • production_designer
  • art_director
  • set_decorator
  • costume_designer
  • make_up_department
  • production_manager
  • assistant_director
  • art_department
  • sound_department
  • special_effects
  • visual_effects
  • stunts
  • camera_department
  • animation_department
  • casting_department
  • costume_department
  • editorial_department
  • location_management
  • music_department
  • script_department
  • transportation_department
  • miscellaneous

Each category contains a list of people involved in that role, in the format Model

Person(name='Keanu Reeves', id='nm0000206', url='https://www.imdb.com/name/nm0000206', job='Cast')

Deprecation Notice

MovieDetail.directors and MovieDetail.cast have been deprecated in favor of the new categories structure: MovieDetail.categories['director'] and MovieDetail.categories['cast'] respectively.

Adding MovieDetail.stars as a new attribute to MovieDetail to replace the old MovieDetail.cast attribute.

The old attribute MovieDetail.directors will be removed in a future release and the attribute MovieDetail.cast will be renamed into MovieDetail.stars .

License

This project is licensed under GPL v2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read the CONTRIBUTING file for details on how to contribute to this project.

Issues

Project details


Download files

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

Source Distribution

imdbinfo-0.3.1.tar.gz (470.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imdbinfo-0.3.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file imdbinfo-0.3.1.tar.gz.

File metadata

  • Download URL: imdbinfo-0.3.1.tar.gz
  • Upload date:
  • Size: 470.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for imdbinfo-0.3.1.tar.gz
Algorithm Hash digest
SHA256 fee4105ed32eb4175d6459aa6a5b78a5b4e19004b8287688fde187270864d59f
MD5 e9e653dc3124bcec4898599a07f69e01
BLAKE2b-256 1f750d405f46fc408ab9137a424ec30b2f7c2f59fa3fce9f1f6512e704297f42

See more details on using hashes here.

File details

Details for the file imdbinfo-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: imdbinfo-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for imdbinfo-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 106e7e7d75fcf882231b2af6cb9b38bebb4b0c52eb38bcd32d13f0af25a558a4
MD5 f6df672282915468147f43ed99c59b88
BLAKE2b-256 3cf06dda2fa5d12d33e9392fb781c9551de75aaeceedbbf20ce1b4bd48170217

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page