Skip to content

Repository files navigation

Property Email Analyzer

A tool that fetches property alerts from Gmail, scrapes listing details, and uses Claude's vision capabilities to provide nuanced property analysis.

Features

  • Email Fetching: Connects to Gmail via IMAP and extracts property URLs from alert emails (Domain, REA)
  • Property Scraping: Downloads listing details and images from domain.com.au and realestate.com.au
  • Claude-Driven Analysis: Uses Claude's vision to inspect images and provide judgment-based scoring
  • Floorplan Detection: Automatically identifies and embeds floorplans in reports

Prerequisites

Before using this tool, you need:

  1. Property alerts set up on realestate.com.au and/or domain.com.au

    • Create saved searches with your criteria (suburbs, price range, bedrooms, etc.)
    • Enable email alerts for new listings
    • Alerts should be sent to the Gmail account you'll configure below
  2. Gmail account with alerts arriving (can be a dedicated account for property alerts)

  3. Claude Code installed for AI-powered analysis

Quick Start

# Setup
cd property
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Run interactive setup in Claude Code
claude
/property:setup

The setup wizard will:

  1. Configure your Gmail IMAP credentials
  2. Quiz you on your property preferences
  3. Generate credentials.yaml and criteria.yaml

Usage

Recommended Workflow

# Step 1: Run in terminal (scrapes domain.com.au, saves realestate URLs)
./preload.sh --days 7

# Step 2: Run in Claude Code (scrapes realestate.com.au, analyzes all)
/property:process-preloaded

Preload options:

./preload.sh                    # Last 7 days (default)
./preload.sh --days 14          # Last 14 days
./preload.sh -d 14 -f 7         # Between 7-14 days ago
./preload.sh --since-last       # Since last successful fetch
./preload.sh --verbose          # Show detailed output

Why preload? Processing a week of property alerts can take 1+ hours and consume significant Claude tokens. The preload script handles the token-free work (email fetching, domain.com.au scraping) outside of Claude, so you only pay for what requires AI:

  • Python (free, fast): Email fetching, domain.com.au scraping, URL resolution
  • Claude (tokens): Realestate.com.au scraping (Playwright for bot bypass), vision analysis

Pipeline Commands

Command Description
/property:setup Interactive setup wizard for credentials and preferences
/property:process-preloaded Process after ./preload.sh (scrape REA + analyze all)
/property:analyze-preloaded Quick analysis only (skip REA scraping)
/property:run-domain Domain.com.au only (Python scraping + Claude analysis)
/property:run-hybrid Both sites (Python + Playwright for realestate.com.au)

Individual Commands

Command Description
/property:scrape <url> Scrape a specific listing (auto-detects site)
/property:analyze <path> Analyze a scraped property with Claude vision
/property:list List all saved properties with scores
/property:report <id> View analysis report for a property
/property:shortlist Get top recommendations

Python CLI (Without Claude Code)

source .venv/bin/activate

# Fetch emails from last 7 days
python -m scripts.email_reader --days 7

# Scrape a specific property
python -m scripts.scraper "https://www.domain.com.au/..."

# Generate summary of all properties
python -m scripts.summary

Note: Python CLI can scrape but cannot analyze (analysis requires Claude's vision).

How Analysis Works

Unlike rigid scoring algorithms, this tool uses Claude's judgment:

  1. Read property data - beds, baths, price, features
  2. View all images - verify claims, spot details algorithms miss
  3. Identify floorplan - rename and embed in report
  4. Compare to criteria - evaluate against your criteria.yaml
  5. Two-part scoring - Criteria Score (objective) + Vibe Score (subjective)

This catches things like:

  • Second bedroom too small to be a usable study
  • Wide-angle lens distortion making rooms look bigger
  • Claims in listing not matching what's visible in photos

Configuration

Files

File Purpose Created By
credentials.yaml Gmail IMAP credentials /property:setup
criteria.yaml Your search criteria (must-haves, preferences, avoid) /property:setup
preferences.md Human-readable preferences + scoring guide /property:setup

Manual Setup (Alternative)

If not using /property:setup:

cp credentials.yaml.example credentials.yaml
cp criteria.yaml.example criteria.yaml
# Edit both files with your details

Gmail App Password

  1. Enable 2-factor authentication on your Gmail account
  2. Go to https://myaccount.google.com/apppasswords
  3. Create an app password for "Mail"
  4. Use the 16-character password in credentials.yaml

Scoring System

Properties receive two scores:

Criteria Score (0-100) - Objective match against your criteria.yaml:

  • Must-haves missing = major penalty
  • Strong preferences present = bonus points
  • Avoid items present = penalties

Vibe Score (1-10) - Subjective assessment:

  • "Would I live here?" gut feel
  • Value for money
  • Presentation quality
  • Layout efficiency

Final Score = Criteria Score + (Vibe Score - 5)

Score Meaning
85-100 Exceptional match
70-84 Good match
55-69 Okay - notable gaps
40-54 Below average
< 40 Poor match

Output Structure

output/
└── <suburb>/
    └── <property-id>/
        ├── metadata.json   # Scraped data + scores
        ├── report.md       # Claude's analysis
        └── images/
            ├── floorplan.jpg  # Identified floorplan
            └── image_*.jpg

Requirements

  • Python 3.11+
  • Gmail account with app password
  • Claude Code (for analysis features)
  • Playwright MCP server (for realestate.com.au scraping)

Troubleshooting

"No new property URLs found"

  • Check Gmail label exists and has emails
  • Verify app password is correct (16 characters, no spaces)
  • Try --verbose flag for debug output

Realestate.com.au scraping fails

  • Requires Playwright MCP server running
  • Check /mcp in Claude Code to verify connection
  • Site has bot protection - Playwright bypasses this

Analysis not running

  • Analysis requires Claude Code (uses vision capabilities)
  • Python CLI can only scrape, not analyze
  • Check property has images in images/ folder

About

Fetches your property alerts and analyses them in claude code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages