A Python backend service that generates detailed neighborhood intelligence reports on demand. Given a ZIP code, city, county, or census tract, it fetches demographic data from the US Census Bureau (ACS 5-year estimates) and institution counts from OpenStreetMap, then produces both a web-viewable report and a downloadable PDF.
Designed for community organizations, nonprofits, and researchers who need actionable neighborhood data without a data science background.
Demographics (from Census ACS)
Community Institutions (from OpenStreetMap)
AI-Generated Overview A single prose paragraph contextualizing the numbers for a non-technical audience β generated by Claude Haiku and cached per geography.
Two report tiers:
βββ Executive Summary: Demographic cards + Community Needs + AI overview
βββ In-Depth: Full charts + trend breakdowns (future)
Caching:
βββ SQLModel (SQLite) stores reports by geography + ACS vintage year
Reports are never re-fetched until Census releases new data
Output:
βββ Web view: Rendered HTML in browser
βββ PDF: WeasyPrint converts same HTML β styled PDF
| Category | Tools |
|---|---|
| Backend | Python, FastAPI |
| Census Data | censusdis library (ACS REST API) |
| Map Data | overpy (OpenStreetMap Overpass API) |
| PDF Generation | WeasyPrint |
| Database | SQLModel, SQLite |
| AI Prose | Claude Haiku (claude-haiku-4-5) |
| Charts | matplotlib |
Hybrid AI: Only the Overview paragraph uses Claude β everything else is deterministic. Community Needs flags (e.g., βhigh poverty rateβ) use rule-based thresholds so the report is reproducible and auditable. The AI call is cached so each geography only pays the cost once.
Lay-person readability: Every stat includes a plain-language label. The Overview contextualizes numbers in terms of what they mean for a community organization, not just what they are.