Skip to content

jakubclark/title-explorer

Repository files navigation

Title Explorer

Search for movies and TV Shows

Endpoints

  • POST /api/title
    • Add a new Title to the database
    • Creates an appropriate Title node and associated Person nodes (for the directors, stars, etc.)

Running Locally

Prerequisites:

  • Install the dependencies with pipenv install --dev
  1. Start the neo4j Docker Container
    • docker run --name neo4j-container -v $PWD/neo4j/data:/data -v $PWD/neo4j/logs:/logs --env NEO4J_AUTH="neo4j/pass" -p 7474:7474 -p 7687:7687 --rm neo4j:3.5.3
  2. Start the application
    • pipenv run python -m title_explorer

Adding new Titles

In order to create new Title entries in the database:

  1. Create a Title object according to the title-object definition found in schema.json
  2. POST to the /api/title endpoint.
  3. If the json-body conforms to the json-schema, then the title will automatically be added to the neo4j database
    • In case of a data-validation failure, a 400 error is returned, with a description of what went wrong

Example Graph

An example graph can be generated by running the neo4j instance along with the title_explorer server, and running the python file in resources/python/example_graph

This will create a graph of the top Movies and TV Shows, based on user reviews.

A nice visualization can then be found at localhost:7474.

Use neo4j as the username and pass as the password, and run the cypher query:

  • MATCH (n1)-[r]->(n2) RETURN r, n1, n2

The relationships are from Person to Title:

  • Paul Rudd stars_in Ant-Man
  • Joe Russo directed Avengers: Infinity War

Scraper Routes

There is an ommited python module scraper_routes, that holds routes that when called, result in title-explorer scraping/collecting Title information, and storing the results in the neo4j instance.

Goals

  • Get acquainted with asyncio in Python
  • Become familiar with webscraping using BeautifulSoup
  • Store data in a graph database

About

Explore Movies and TV Shows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages