A production-ready framework for real estate platforms, SaaS providers, and compliance pipelines.
300+ Rules โข 100+ Jurisdictions โข 1000+ Triggers โข Neuro-Symbolic AI
๐บ๐ธ ๐จ๐ฆ ๐ฆ๐บ ๐ช๐บ ๐ฌ๐ง Supporting Multi-Jurisdictional Compliance (US, Canada, EU, Australia, UK)
Powered by FairProp Inspector: Our open-source, edge-native compliance engine.
Features โข Quick Start โข Real World Examples โข Documentation โข API โข Contributing
| ๐บ๐ธ North America 180 rules (15 states + 20 cities) |
๐ช๐บ Europe 18 countries |
๐ Asia-Pacific 12 regions |
| ๏ฟฝ Middle East 4 countries |
๏ฟฝ Africa 5 countries |
๐ Latin America 8 countries |
Supported Regions:
- ๐บ๐ธ United States: All 50 states + DC + Federal FHA
- ๐จ๐ฆ Canada: Federal + Provincial (ON, BC, QC)
- ๏ฟฝ๏ฟฝ UK โข ๐ฉ๐ช Germany โข ๐ซ๐ท France โข ๐ช๐ธ Spain โข ๐ฎ๐น Italy โข ๐ณ๐ฑ Netherlands
- ๏ฟฝ๐ณ China โข ๐ฏ๐ต Japan โข ๐ฐ๐ท South Korea โข ๐ฎ๐ณ India โข ๐ธ๐ฌ Singapore
- ๐ฆ๐บ Australia (+ 3 states) โข ๐ณ๐ฟ New Zealand
- ๏ฟฝ๐ท Brazil โข ๐ฒ๐ฝ Mexico โข ๐ฆ๐ท Argentina โข ๐จ๐ฑ Chile
- ๐ฆ๐ช UAE โข ๐ธ๐ฆ Saudi Arabia โข ๐ฎ๐ฑ Israel โข ๐น๐ท Turkey
- ๏ฟฝ๐ฆ South Africa โข ๐ณ๐ฌ Nigeria โข ๐ฐ๐ช Kenya โข ๐ช๐ฌ Egypt
๐ View Full Coverage Statistics
| Metric | Count |
|---|---|
| Total Jurisdictions | 100+ |
| Countries | 40+ |
| US States | 50 + DC |
| Languages Supported | 20+ |
| Protected Categories | 150+ |
| Active Rules | 300+ |
|
Layer 1: Rule-Based
|
Layer 2: Semantic Search
|
Layer 3: Neural Guardrail
|
graph LR
A[Input Text] --> B{Cache Check}
B -->|Hit| C[Return Cached Result]
B -->|Miss| D[3-Layer Detection]
D --> E[Rule-Based]
D --> F[Semantic Search]
D --> G[Neural Guardrail]
E --> H[Aggregate Results]
F --> H
G --> H
H --> I[Cache & Return]
- โก 100x Performance: LRU caching with SHA-256 keys
- ๐ฆ Batch Processing: Native batch API for high-volume scanning
- ๐ Hot-Reload: Update rules without downtime
- ๐ REST API: FastAPI with auto-generated Swagger docs
- ๐ Browser Extension: Real-time checking on Zillow, Realtor.com
- ๐ Audit Trail: Cryptographically signed compliance certificates
- ๐ Analytics: Usage tracking and violation rate monitoring
- ๐ผ๏ธ Multi-Modal: Text + Image (OCR) + Logo detection
- ๐ Privacy-First: 100% local execution, no data leaves your machine
# Clone the repository
git clone https://github.com/ZheWang-stack/FairProp-AI.git
cd fairprop
# Install with all dependencies
pip install -e .from fairprop import FairHousingAuditor
# Initialize with global jurisdictions
auditor = FairHousingAuditor(
jurisdictions=['california', 'uk', 'germany', 'singapore']
)
# Scan text
report = auditor.scan_text("Perfect for young professionals near churches")
# Results
print(f"Compliance Score: {report['score']}/100")
print(f"Safe to Publish: {report['is_safe']}")
print(f"Violations Found: {len(report['flagged_items'])}")# Single jurisdiction
fairprop scan listing.txt -j california
# Multi-jurisdiction compliance
fairprop scan listing.txt -j california -j nyc -j uk -j germany
# AI-powered fix suggestions
fairprop fix "Perfect for young bachelor"
# Output: "Perfect for a single person"
# Batch processing
find ./listings -name "*.txt" -exec fairprop scan {} -j california \;python api_server.py
# API available at http://localhost:8000
# Docs at http://localhost:8000/docsSingle Scan
curl -X POST http://localhost:8000/api/scan \
-H "Content-Type: application/json" \
-d '{
"text": "Luxury apartment perfect for young professionals",
"jurisdictions": ["california", "nyc"],
"use_cache": true
}'Response:
{
"score": 75,
"is_safe": true,
"flagged_items": [
{
"id": "FHA-AGE-001",
"category": "Age (Implicit)",
"severity": "Warning",
"found_word": "young professionals",
"suggestion": "Remove age-related language. Describe property features instead."
}
]
}Batch Processing
curl -X POST http://localhost:8000/api/scan/batch \
-H "Content-Type: application/json" \
-d '{
"items": [
{"text": "First listing", "jurisdictions": ["california"]},
{"text": "Second listing", "jurisdictions": ["uk", "germany"]}
]
}'Response:
{
"results": [...],
"total_scanned": 2,
"total_violations": 0
}Hot-Reload Rules
curl -X POST http://localhost:8000/api/reload-rulesResponse:
{
"status": "success",
"message": "Rules reloaded: 251 โ 300",
"old_count": 251,
"new_count": 300
}| Endpoint | Method | Description |
|---|---|---|
/api/scan |
POST | Single text scan |
/api/scan/batch |
POST | Batch processing |
/api/reload-rules |
POST | Hot-reload rules |
/api/health |
GET | Health check |
/api/stats |
GET | Usage statistics |
/docs |
GET | Interactive API docs |
| Metric | Value | Notes |
|---|---|---|
| Cache Hit Latency | < 1ms | SHA-256 LRU cache |
| Cache Miss Latency | < 200ms | Full 3-layer scan |
| Throughput | 1000+ req/s | With caching enabled |
| Batch Processing | 100+ items | Single API call |
| Memory Footprint | ~2GB | With AI models loaded |
| Startup Time | ~50ms | Lazy model loading |
AI/ML Stack:
- ๐ค HuggingFace Transformers - BART, Flan-T5
- ๐ SentenceTransformers - all-MiniLM-L6-v2 (22M params)
- ๐๏ธ ChromaDB - Vector database for semantic search
- ๐งฎ NumPy + OpenCV - Computer vision for logo detection
Backend:
- โก FastAPI - High-performance async API
- ๐จ Streamlit - Interactive web dashboard
- ๐ง Typer + Rich - Beautiful CLI
- ๐ Pydantic - Data validation
DevOps:
- ๐ณ Docker - Containerization
- โ๏ธ GitHub Actions - CI/CD pipeline
- ๐ Pytest - Testing framework
- ๐ Pylint - Code quality
| Document | Description |
|---|---|
| API Reference | Complete REST API documentation |
| Deployment Guide | Docker, Kubernetes, Cloud deployment |
| Architecture | System design and technical deep-dive |
| Rule Authoring | How to create custom compliance rules |
| Global Reference | Complete jurisdiction list with examples |
|
|
We โค๏ธ contributions! FairProp is built by the community, for the community.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# 1. Create rule file
touch rules/international/your_country.json
# 2. Add to jurisdiction map
# Edit fairprop/auditor.py
# 3. Test
fairprop scan test.txt -j your_country
# 4. Submit PR!See CONTRIBUTING.md and Rule Authoring Guide for details.
- Multi-language NLP - Native support for non-English text
- Fine-tuned Models - Domain-specific BERT for fair housing
- Mobile App - iOS/Android with OCR scanning
- Plugin System - Extensible architecture for custom checks
- Real-time Dashboard - Analytics and monitoring UI
- More Jurisdictions - Expand to 200+ regions
This project is licensed under the MIT License - see the LICENSE file for details.
Built on the shoulders of giants:
- Acknowledgement: This project builds upon the architectural concepts of the
fair-housing-guardrailmodel open-sourced by Zillow Group. We extend our gratitude to Zillow for their contribution to the open-source community. - Powered by HuggingFace Transformers
- API framework by FastAPI
- Vector search by ChromaDB
- ๐ Bug Reports: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: docs/
- โญ Star this repo if you find it useful!
FairProp-AI is an automated compliance screening tool. It does NOT provide legal advice or definitive legal determinations.
- The use of this tool does not guarantee compliance with the Fair Housing Act or any other law.
- Results are probabilistic and based on heuristic rules.
- ALWAYS consult a qualified attorney for final review of real estate advertisements.
