Coder Social home page Coder Social logo

news-api-etl's Introduction

News API ETL

This project is an ETL (Extract, Transform, Load) pipeline for the News API: https://newsapi.org/. It extracts news articles and sources from the News API, transforms it, and loads it into a PostgreSQL database.

Prerequisties

  • Docker

Getting started

  1. Clone the repository

    git clone https://github.com/oa36/news-api-etl.git
  2. Create a .env file based on the provided env.example file.

    • You need to update your API_KEY in .env, the reset of required variables are already defined in env.example.
    • DOCKER_DEFAULT_PLATFORM=linux/amd64 is needed if you have M1-Based mac: check here
    cp env.example .env
  3. Run the following command to start the application:

    docker-compose up --build
  4. The PostgreSQL database will be initialized with the schema and tables defined in db/init.sql. Connect to the database using database client tool (e.g. TablePlus) using the credentials specified in .env.

Project structure

  • Dockerfile: Dockerfile for the ETL pipeline service.
  • Pipfile: Pipfile for the ETL pipeline service.
  • Pipfile.lock: Pipfile lock file for the ETL pipeline service.
  • README.md: This file.
  • config: Directory containing configuration files for the ETL pipeline
    • db_config.py: Configuration file for the database connection.
  • db: Directory containing the database initialization SQL file.
    • init.sql: SQL file for initializing the PostgreSQL database.
  • docker-compose.yml: Docker Compose file for running the ETL pipeline and database service.
  • env.example: Example environment file containing required environment variables for the ETL pipeline service.
  • src: Directory containing source code for the ETL pipeline service.
    • data_models.py: Contains data model definitions for SQLAlchemy.
    • news_etl.py: Contains the ETL pipeline code.
    • utils.py: Contains utility functions used by the ETL pipeline.

news-api-etl's People

Watchers

Omar Aburayyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.