Project Hub

Project · Egypt spare parts price tracker

Seeing which of 13 Egyptian sellers is cheaper on 154 shared spare parts, every week

The problem

An Egyptian spare-parts retailer sells the same parts as 13 online shops whose prices move weekly. Nobody knows which competitor is cheaper on which part until the customer buys elsewhere.

The solution

A weekly pipeline reads 13 sellers' prices, checks every row, keeps each price with its date, matches parts by part number, and emails when a competitor undercuts us. Gaps show in Power BI.

How it works

  • Collect: Prices read weekly from 13 Egyptian spare-parts sellers
  • Check: Every row checked; a bad row is set aside with its reason
  • Store: Every price kept with its date
  • Match: The same part matched across sellers by part number
  • Report: An email when a competitor undercuts us, and Power BI gap pages

A closer look

Pipeline diagram: the seller websites and our parts catalogue flow through bronze, silver and gold tables, ending in a price alert email and a Power BI report.
The weekly pipeline, with the real task and table names.
Data flow: one box per step, in run order, from the input files to the report.
The steps, in run order.
Star schema: one fact table of 28,825 offers for one run week, joined to 13 sellers, 936 parts and one date.
One fact table, three dimensions.
Airflow graph view of a successful weekly run: load_reference, fetch_pages for 13 sellers, load_silver, match, build_gold and send_alert.
The Airflow DAG, run every week.
Airflow grid view of the last five runs, task by task, with each run's length.
Run history in Airflow, task by task.

The code

offers.append({
    "listing_key": str(p["id"]),
    "title": p["title"],
    "price": price,
    "currency": "EGP",
    "is_discounted": bool(price and was and was > price),
    "url": f"{base}/products/{quote(p['handle'])}",
    "brand": (p.get("vendor") or "").strip() or None,
    "part_no": scrape.part_code(variant.get("sku")),
    "in_stock": variant.get("available"),
})
scrapers/nautoexpress.py

The impact

  • Every competitor price read weekly, no browsing.
  • Where a competitor sells below us, seller by seller.
  • A one-week promotion stands apart from a new normal.
  • Failing rows set aside with a reason, never dropped.

The result

28,825 prices from 13 sellers in one weekly run: 88 of 154 shared parts (57.1%) have a seller at least 5% below the market's middle price.

Built with

  • Python
  • Web scraping
  • Airflow
  • PostgreSQL
  • Power BI