← Back to projects
04 / datalive

Used Car Deal Finder

An interactive Dash dashboard for exploring used car listings and surfacing potential deals, vehicles priced below the median for comparable manufacturer, model, and year combinations. Includes a stratified-sampling data pipeline, pytest coverage, and CI via GitHub Actions.

  • Below-median deal finder
  • Stratified-sampling pipeline
  • CI via GitHub Actions
lang
Python
stack
DashPlotlypandaspytest

The problem

Used car listings show a price but not whether that price is good. I wanted a tool that compares each listing with similar cars and surfaces the ones priced below market, with filters for narrowing down to cars someone would actually buy.

Key decisions

  • Defined a deal score as the median price of listings with the same manufacturer, model, and year, minus the listing's price. I used the median rather than the mean so a few extreme listings don't distort what counts as market price.
  • Filtered out unrealistic listings before scoring: prices outside $1,000 to $100,000, years before 1990, and mileage outside 1,000 to 300,000.
  • Built a stratified sample of about 8,000 listings, sampled proportionally by manufacturer, so the app fits in the repo and loads on a free host without dropping rarer brands.
  • Split the app into data, layout, and callback modules, and stored filter state in the URL so any view can be bookmarked, shared, or exported to CSV.
  • Ran ruff linting, a formatting check, and pytest on every push and pull request through GitHub Actions.

Challenges

  • Missing condition values showed up as the text 'nan' in filters and tables, because converting columns to strings turned empty values into a literal 'nan'. I changed the loading step so missing values stay missing.
  • That first fix cleaned text row by row. I later replaced it with pandas' vectorized string methods, which also leave missing values alone, and stopped copying the full DataFrame on every filter change.

Results

  • Live on Render with linked charts: clicking a point in the price-vs-mileage plot or the top-deals chart opens the full listing.
  • 10 pytest tests cover data loading and the URL-to-filter round trip, enforced in CI.

What's next

  • Adjust the deal score for mileage within each group, since a cheap car with high mileage isn't necessarily a deal.
  • Flag scores from small comparison groups, where one or two listings set the median.