Skip to content
프로젝트

rat-nick/film-data-ingestion-pipeline

GitHub에서 보기

소개

A repository defining a simple data pipleine for ETL jobs relating to media metadata.

데이터 및 분석

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+1
in 7 days
+1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Film Data Ingestion Pipeline

This project is designed to fetch, process, and store film metadata from The Movie Database (TMDB) using Apache Airflow. The pipeline consists of several components including data fetching, processing, and loading into a PostgreSQL database.

Project Structure

  • dags/: Contains the Airflow DAGs.
    • weekly_film_discovery_dag.py: Defines the DAG for discovering and processing films on a weekly basis.
  • dags/utils/: Contains utility scripts.
    • films.py: Contains functions to fetch film data and genres from TMDB.
  • docker-compose.yaml: Docker Compose configuration to set up the Airflow and PostgreSQL services.
  • schema.sql: SQL schema for the database containing the production data.

Getting Started

Prerequisites

  • Docker
  • Docker Compose
  • TMDB API key

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/film-data-ingestion-pipeline.git
    cd film-data-ingestion-pipeline
    
  2. Create a .env and run the following commands:

    touch .env
    echo "TMDB_API_KEY=<your_api_key_here>" >> .env
    echo "AIRFLOW_UID=50000" >> .env
    echo "AIRFLOW_GID=0" >> .env
    
  3. Start the services using Docker Compose:

    docker-compose up -d
    
  4. Access the Airflow webserver at http://localhost:8080 and log in with the default credentials (airflow/airflow).

  5. Add a new connection from the Admin tab. You should use the following parameters:

    Parameter Value
    Connection Id media-metadata-db
    Connection Type Postgres
    Host media-db
    Schema media
    Login media
    Password media
    Port 5432

Of course, you could use a DBaaS like neon, but the free tier is limited for the data that will be ingested. Just don't forget to change the connection parameters.

  1. Enable the weekly_film_discovery DAG and voila!

Usage

The pipeline is scheduled to run weekly and will:

  1. Fetch film data from TMDB.
  2. Process and save the data to a temporary file.
  3. Load the data into the PostgreSQL database.
  4. Clean up temporary files.

Extra

If you wish to explore the media database, the port on the host is 15432

Disclaimer

  • This project uses the TMDB API but is not endorsed or certified by TMDB.
  • TMDB data is used in compliance with their Terms of Use.
  • This project is for personal and educational purposes only and does not redistribute or resell TMDB data.

For more information, visit TMDB's official website.

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

관련 프로젝트 살펴보기

불러오는 중…