Skip to content

This project scrapes and analyzes retail product prices since Election Day, revealing trends in consumer costs, inflation, and market response. Powered by SerpAPI, pandas, and daily scraping logic, it enables year-over-year comparisons and visualizes price changes across common goods and platforms.

blkpvnthr/The-Cost-of-Democracy

Repository files navigation

🗳️ The Cost of Democracy

Track how retail prices have changed since the 2024 U.S. presidential election.

A lightweight, data-driven project that scrapes and analyzes product prices over time to explore the economic aftermath of U.S. democratic transitions. Built using Python, SerpAPI, and pandas.

Demo GIF


🔍 What This Project Does

  • 🔎 Search Google Shopping for product prices
  • 🕒 Store historical price data in CSV for analysis
  • 📈 Run price comparisons
  • 📊 Visualize product-level price changes over time
  • 🔔 (Optional) Get alerts when prices shift dramatically

⚙️ Tech Stack

  • Python 3.9+
  • SerpAPI – for structured Google Shopping results
  • pandas – for data manipulation
  • matplotlib – (optional) for visualizations
  • schedule – (optional) for automating daily price logs

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/your-username/the-cost-of-democracy.git
cd the-cost-of-democracy

2. Install Dependencies and Get Your SerpAPI Key

pip install -r requirements.txt

Create a free SerpAPI account at serpapi.com and get your API key.

3. Create a .env file and add your SerpAPI key (Git will automatically ignore this file)

SERPAPI_KEY="your_api_key_here"

🤝 Working as a Team

Git Branching Workflow

  1. Create a new feature branch:

    git checkout -b feature/your-feature-name
  2. Set the branch to track your remote:

    git push --set-upstream origin feature/your-feature-name
  3. Before making new changes, sync with main using rebase. Ensure your working directory is clean:

    git status        # Check for uncommitted changes
    git pull --rebase origin main
  4. If there are changes (in red), stage them before continuing:

    git add .
    git commit -m "syncing with main"
  5. Make your changes, then commit and push:

    git add .
    git commit -m "your descriptive commit message"
    git push
  6. Open a Pull Request (PR) on GitHub to merge your feature branch into main.

Once the PR is opened, we’ll schedule a quick walkthrough to review your changes.

Open a Pull Request Example


✅ Best Practices

  • Use meaningful branch names like feature/price-alerts or fix/yoy-analysis.
  • Write clear and consistent commit messages.
  • Keep PRs small and focused.
  • Avoid making more commits after submitting a PR unless part of review feedback.

Made with democracy in mind.

About

This project scrapes and analyzes retail product prices since Election Day, revealing trends in consumer costs, inflation, and market response. Powered by SerpAPI, pandas, and daily scraping logic, it enables year-over-year comparisons and visualizes price changes across common goods and platforms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •