Skip to content

richardfogaca/simple-movies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Ingestion

This project demonstrates how to build a simple application using Flask-AppBuilder that retrieves movie data from the Wikidata API, processes the JSON data, saves it to an SQLite3 database using SQLAlchemy, and displays it in a simple interface.

Prerequisites

  • Python 3.9.6 or higher
  • A virtual environment (recommended)

Installation

Follow these steps to set up the project:

  1. Clone the repository:
$ git clone [email protected]:richardfogaca/simple-movies.git
$ cd simplemovies
  1. Create a virtual environment and activate it:
$ python3 -m venv venv
$ source venv/bin/activate
  1. Install the required dependencies:
(venv) $ pip install -r requirements.txt
  1. Set the FLASK_APP environment variable:
$ export FLASK_APP=SimpleApp/run.py

Configuration

  1. Configure the Flask app by updating the config.py file as needed. The default configuration uses SQLite3 as the database.

Database Setup

  1. Create the database tables:
$ python3
>>> from app import db
>>> db.create_all()
>>> exit()
  1. To create an admin user, run the following command and fill the requested data.
(venv) $ flask fab create-admin

Running the Application

  1. Run the application:
(venv) $ python3 run.py

The application will start on the following URL: http://127.0.0.1:5000

  1. To load movies data use the following endpoint: http://127.0.0.1:5000/movies/load_data/

This will fetch the data from wikidata and redirect to the list endpoint: http://127.0.0.1:5000/movies/list/

  1. If you would like to delete all data from the database, just use the folowing endpoint: http://127.0.0.1:5000/movies/drop_data/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •