This project parses IMDB data sources into a Postgres database to allow for more advanced queries and searches.
The data is provided for free for Non-Commercial use from IMDB under specific terms.
THIS PROJECT IS NOT INTENDED FOR COMMERCIAL USE. ANY FORKING OF THIS PROJECT IMPLIES THAT YOU HAVE READ AND ACCEPT THESE TERMS.
This project:
- Downloads IMDB data sources from https://datasets.imdbws.com/
- Parses the downloaded sources into more clean TSV files.
- Creates the database schema without contraints.
- Copies the parsed TSVs to the tables.
- Performs additional cleanup to remove orphaned data.
- Applies constraints to the tables.
- Starts PGAdmin for easy database management.
Partly influenced from: https://gist.github.com/1mehal/13c85e108cbc906f5ec34d28d75b1968
Feel free to open an issue or PR if you have any questions or suggestion. That said, this project is a passive hobby, so response and application of changes is not guaranteed.
The author takes no responsibility for how this project is used.
Credentials are currently in the clear, so currently intended for local use only.
- Run
docker-compose up. - Wait until PGAdmin is available. This will take at least 5 minutes as the data needs to be parsed and loaded and then constraints applied, and the data is NOT clean.
- Use PGAdmin to explore the data.
- Bring your own DB explorer if you like. See Credentials below.
title- Contains the basic title information.parse_sources.pyignores Adult content.episode- Contains episode information.initdb/load_data.shdrops episodes with an orphaned series or ids intitles.person- Contains person information.parse_sources.pydrops rows without a name.principal- Contains principal information.initdb/load_data.shdrops rows with an orphaned title or person.rating- Contains rating information.initdb/load_data.shdrops rows with an orphaned title.
Foreign keys and indexes are added to improve query performance.
There are five sets of credentials, one for PG Admin, the rest for the database:
- PGAdmin:
admin@admin.org:admin- set in the compose file. - Postgres Admin:
postgres:pgpass- set in the compose file. - Owner Role:
imdbowner:ownerpass- set in theinitdbscripts. - Read-Write Role:
imdbreadwrite:readwritepass- set in theinitdbscripts. - Read-Only Role:
imdbreadonly:readonlypass- set in theinitdbscripts.`
scripts/download_sources.py- Downloads the IMDB data sources.scripts/parse_sources.py- Parses the downloaded sources into TSV files.
Both scripts can be configured to run locally for testing purposes. See the scripts for details.
If docker compose up fails due to a timeout, wait a few minutes, run docker ps -a to see if the db container is healthy, and then run docker compose up again.
- Process the Title AKAs file.
- Process the Crew file.
- Configure project to read passwords from a local file.
- Test on a remote machine to run independently.