← Back

Lease Audit

Built

Signature capability

On an adversarial test set of 51 leases and 804 payments with 25 planted defects, it caught all 25 (100% detection) with zero false positives.

What it is

It parses .xlsx files of lease terms and payment records into typed Pydantic models, then runs seven independent validators: reconciliation, completeness, consistency, duplicates, format checks, outliers, and business rules. The reconciliation engine is the core: it fuzzy-joins payments to leases (Levenshtein tenant matching), then flags underpayments, missing months, escalation mismatches, and ghost payments with no matching lease. Business rules encode state-specific law (CA/NY/NJ deposit caps) from a JSON knowledge base. Findings are scored by severity and rendered to a PDF report plus an annotated Excel workbook; an optional Claude API pass adds a qualitative narrative from PII-free aggregate stats. It ships as a FastAPI service and a CLI.

Highlights

  • Seven independent validation engines (reconciliation, completeness, consistency, duplicates, format, outliers, business rules) over a clean validator base class
  • 116 tests passing (100%), across 9 suites including an adversarial harness that plants bugs and grades detection; graded A with 0 false positives
  • Reconciliation does fuzzy tenant-name joins via Levenshtein ratio so typos like 'Liberty Tax Servicse' still match the right lease
  • State-law deposit limits (CA 2x, NY 1x, NJ 1.5x rent) driven from an external JSON knowledge base rather than hardcoded logic
  • Performance: 2,000 leases + 10,000 payments audited in under 30s
  • ~3,800 lines of Python 3.11+, FastAPI + CLI, WeasyPrint PDF + openpyxl annotated-XLSX output, optional Claude analysis with graceful no-key fallback

Tech · Python 3.11+, FastAPI, Pydantic v2, pandas, openpyxl, WeasyPrint, Jinja2, Anthropic SDK, structlog, pytest