Git Product home page Git Product logo

nadyamartini / automated-e-commerce-sales-analysis-pipeline Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 199 KB

Airflow: Automated E-commerce Sales Analysis Pipeline. This data engineering project focuses on automating the process of downloading and integrating incremental sales data from an API into a normalized PostgreSQL database, with daily update of an analytical sql view that showcases the profitability and popularity of different product categories.

Python 100.00%

automated-e-commerce-sales-analysis-pipeline's Introduction

Automated-E-commerce-Sales-Analysis-Pipeline-in-Airflow

This data engineering project focuses on automating the process of downloading and integrating incremental sales data from an API into a normalized PostgreSQL database, with daily update of an analytical sql view that showcases the profitability and popularity of different product categories.

First step:

Database design.

I connected to API and investigated what type of data are expected to be updated. Created two schema in PostgreSQL: "staging" and "mart". Schema "staging" includes table "user_order_log", which is made to be fit for daily update data file from API. This are raw and unproccesed data that need to be watched. Schema "mart" is normalized database schema to store the collected data. It containes tables "city", "customer", "item", "sales" and "calendar".

Second step:

Creating aggregated table.

At this step I created a table called "customer_retention" to analyze the profitability and popularity of various product categories. On a weekly basis, this table tracks the number of purchases made by new customers, returning customers, and customers who requested refunds for different item categories in different cities. This table also shows revenue metrics for each customer type and in each product category by weeks. This aggregated table can provide valuable insights into customer behavior and sales performance of each item category, empowering informed decision-making for business strategies.

Third step:

Data updating Automation.

In this step, an Apache Airflow DAG (Python script) is implemented to automate the data updating process. The DAG consists of several steps: connecting to the API to request a report generation, then uploading data to the "staging" schema, specifically the "user_order_inc" table. It further updates tables in schema "mart": "item", "city", "customer", and "sales". Finally, the "customer retention" table is updated. This DAG is scheduled to run daily, ensuring the data is kept up-to-date. It incorporates two layers of data quality assurance testing. The first layer ensures that the file is generated successfully, while the second layer verifies that the number of customers in the 'user_order_log' file is greater than three. These checks are critical: script will stop itself if the file is missing or it contains three or fewer customers. In such cases, an error notification will be sent via email.

automated-e-commerce-sales-analysis-pipeline's People

Contributors

nadyamartini avatar

Stargazers

 avatar

Watchers

 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.