Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 2.7 KB

README.md

File metadata and controls

77 lines (60 loc) · 2.7 KB

Film Database Retrieval and Analysis

Status: In Progress

Purpose

The purpose of this project is retrieve film data from OMDB and create a localized SQLite databse, with the ability to export tables as a CSV filetype.

Methods Used

  • Relational Databases
  • SQLite
  • OMDB API

Technologies

  • Python (v.3.7)

Required Libraries

  • Pandas
  • SQLite

Project Description

This project utilizes the OMDB API ( See Here ) to retreive film data in the form of a .json file and saves it to a localized SQLite database. This retreival process saves the posters of each film retrieved to a local directory as well. Currently, the film information is stored in 4 tables; Movies, Actors, Directors, and Writers. Each table has the title as a common key.

The film_retrieval.py has functions to initialize a database and then add individual films to specified databases. The table_export.py has basic user input for SQL commands for the purposes of exporting tables as csv from the SQLite database.

The database, posters, and tables directories currently within this repo are for example purposes and are not necessary to retain for function. The directories will automatically be created and populated with the use of the scripts.

To Use:

To create a database, first ensure the above python libraries are installed. Also, you will first need a OMDB API key, which can be acquired from here . Once acquired the API key must be inputted as a parameter in the film_retrieval script. Run the create_database function to name and create a database. The database will then be saved as SQLite file in the database directory. Run the search_movie function to search films by title. Added movies, directors, actors, and writers will be added to the appropriate tables within the specified database. Posters retrieved for each film will be saved to the posters directory.

Running the table_export.py script will prompt you for input of a SQL command to generate a table from the specified database. The database the script connects to will need to be changed in the parameters section. Note that the final ";" is not necessary for input and the command disallows for the input of new lines, unfortunately. The generated table will be saved to the tables directory under the inputted name.

To Do:

  • Add in a Twitter sentiment analysis function to retrieve current sentiment data using the Twitter API

Author:

Gunnar Dahm