Skip to content

TenTen-Teng/MVSer

Repository files navigation

MVSer (Movie and Music Tracker)

Build Status

Please check PyPi Link

TenTen-Teng
TenTen-Teng
Ieleniayu
Ieleniayu

MVSer stands for Movie and Music Tracker. It is a Python package designed to help users search for music featured in movies, explore detailed movie and music information, and get recommendations. Using public APIs like TMDB and Spotify, MVSer offers a seamless experience that combines movie and music data tailored to the user's preferences.

Structure

MVSer

There are two sub-packages in this package, movie and music_user respectively.

Sub-packages

movie.py

Sub-package, movie is used to search movie information from TMDB public API, and parse API response based on user inputs and preferences. This sub-package also recommands the most trendy movies.

Module: MVS

This module inherits functionality from the Movie and Music modules.

Belongs to movie.py sub-package.

Main functions:

  • return_movie_results: Call Movie class to search for movie information based on user inputs and preferences. Return a dictionary of results.
  • return_music_results: Call Music class to search related music information based on user inputs and preferences. Return a list of results.
  • return_recom: Call recommandation functions from both classes. Return a tuple of lists for movie and music recommendations..
  • display_movie_details: Display movie results.
  • display_music_details: Display music results.
  • decoration: Display a pretty layout.
  • start: Start function for MVSer package.
Module: Movie

Belongs to movie.py sub-package.

Main functions:

  • movie_search: Fetch movies and extract useful information.
  • movie_recom: Fetch recommendations and extract useful information.
  • fetch_movie: Call TMDB API to get movie information.
  • fetch_collection: Call TMDB to get movie collection information.
  • fetch_recom: Call TMDB API to get movie recommendations.
  • movie_parse_response: Extract information from API response and wrap up results into a dictionary.
  • test_api_connection: Test API connection.

music_user.py

Sub-package, music_user is used to search related music information from Spoify public API and parse API response based on user inputs and preferences. This sub-package also recommends same artist's music.

Module: Music

Belongs to music_user.py sub-package.

Main functions:

  • music_search: Fetch music albums and extract useful information.
  • fetch_music: Call Spotify API to get raw album data.
  • music_recom: Fetch recommendations and extract useful information.
  • fetch_recommendations: Call Spotify API to get recommended albums.
  • music_parse_response: Extract information from the API response and wrap up results into a dictionary.
Module: User

Belongs to music_user.py sub-package.

Main functions:

  • user_input: Collect user preferences interactively through prompts.
  • check_inputs: Validate user preferences for correctness.
  • display_preference: Display the current user preferences.

How to use

Set up appropriate API keys

To access TMDB API and Spotify API, available API keys are necessary. You can register to TMDB here to get your own API Key, and here to register a client ID and client secret for Spoify API.

Tip

We have attached our test API keys on Canvas for testing purposes. Please use them if you don't want to create your own. :)

Steps

  1. Save your API keys as environment variables. MVSer will fetch API keys accordingly.
# In console.
export TMDB_API_KEY=<your_TMDB_API_token>
export SPOTIFY_CLIENT_ID=<your_spotipy_client_id>
export SPOTIFY_CLIENT_SECRET=<your_spotify_client_secert>
  1. Run MVSer
from movie.mvs import MVS

mvser = MVS()
mvser.start()

Note

Please see test.ipynb as exmaple to call MVSer package.

About

Movie and Music Tracker Project for DATA 533

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •