| name | real-estate-expert |
| version | 1.0.0 |
| description | Expert-level real estate systems, property management, MLS integration, CRM, virtual tours, and market analysis |
| category | domains |
| tags | ["real-estate","property","mls","crm","proptech","listings"] |
| allowed-tools | ["Read","Write","Edit"] |
Real Estate Expert
Expert guidance for real estate systems, property management, Multiple Listing Service (MLS) integration, customer relationship management, virtual tours, and market analysis.
Core Concepts
Real Estate Systems
- Multiple Listing Service (MLS) integration
- Property Management Systems (PMS)
- Customer Relationship Management (CRM)
- Transaction management
- Document management
- Lease management
- Maintenance tracking
PropTech Solutions
- Virtual tours and 3D walkthroughs
- AI-powered property valuation
- Digital signatures and e-closing
- Smart home integration
- IoT sensors for properties
- Blockchain for title management
- Augmented reality for staging
Standards and Regulations
- RESO (Real Estate Standards Organization)
- Fair Housing Act compliance
- RESPA (Real Estate Settlement Procedures Act)
- Data privacy (GDPR, CCPA)
- ADA compliance for websites
- NAR Code of Ethics
Property Listing System
from dataclasses import dataclass
from datetime import datetime
from decimal import Decimal
from typing import List, Optional
from enum import Enum
class PropertyType(Enum):
SINGLE_FAMILY = "single_family"
CONDO = "condo"
TOWNHOUSE = "townhouse"
MULTI_FAMILY = "multi_family"
LAND = "land"
COMMERCIAL = "commercial"
class ListingStatus(Enum):
ACTIVE = "active"
PENDING = "pending"
SOLD = "sold"
WITHDRAWN = "withdrawn"
EXPIRED = "expired"
@dataclass
class Property:
"""Property information"""
property_id: str
mls_number: str
property_type: PropertyType
address: dict
listing_price: Decimal
bedrooms: int
bathrooms: float
square_feet: int
lot_size: float
year_built: int
description: str
features: List[str]
photos: List[str]
status: ListingStatus
listing_date: datetime
listing_agent_id:
coordinates:
:
showing_id:
property_id:
buyer_agent_id:
buyer_name:
requested_date: datetime
duration_minutes:
status:
notes:
:
():
.properties = {}
.showings = []
.saved_searches = {}
() -> Property:
property_id = ._generate_property_id()
mls_number = ._generate_mls_number()
= Property(
property_id=property_id,
mls_number=mls_number,
property_type=PropertyType(property_data[]),
address=property_data[],
listing_price=Decimal((property_data[])),
bedrooms=property_data[],
bathrooms=property_data[],
square_feet=property_data[],
lot_size=property_data.get(, ),
year_built=property_data[],
description=property_data[],
features=property_data.get(, []),
photos=property_data.get(, []),
status=ListingStatus.ACTIVE,
listing_date=datetime.now(),
listing_agent_id=agent_id,
coordinates=property_data.get(, (, ))
)
.properties[property_id] =
._notify_saved_searches()
() -> [Property]:
results = []
.properties.values():
.status != ListingStatus.ACTIVE:
criteria:
.listing_price < Decimal((criteria[])):
criteria:
.listing_price > Decimal((criteria[])):
criteria:
.bedrooms < criteria[]:
criteria:
.bathrooms < criteria[]:
criteria:
.square_feet < criteria[]:
criteria:
.property_type.value != criteria[]:
criteria criteria:
distance = ._calculate_distance(
.coordinates,
criteria[]
)
distance > criteria[]:
results.append()
criteria.get() == :
results.sort(key= p: p.listing_price)
criteria.get() == :
results.sort(key= p: p.listing_price, reverse=)
criteria.get() == :
results.sort(key= p: p.listing_date, reverse=)
results
() -> :
= .properties.get(property_id)
:
{: }
.status != ListingStatus.ACTIVE:
{: }
conflicts = ._check_showing_conflicts(property_id, requested_date)
conflicts:
{
: ,
: conflicts
}
showing = ShowingRequest(
showing_id=._generate_showing_id(),
property_id=property_id,
buyer_agent_id=buyer_agent_id,
buyer_name=buyer_name,
requested_date=requested_date,
duration_minutes=,
status=,
notes=
)
.showings.append(showing)
._notify_listing_agent(.listing_agent_id, showing)
{
: ,
: showing.showing_id,
:
}
() -> Decimal:
.square_feet == :
Decimal()
price_per_sqft = .listing_price / .square_feet
price_per_sqft.quantize(Decimal())
() -> :
comparables = []
.properties.values():
.property_id == subject_property.property_id:
.property_type != subject_property.property_type:
.status != ListingStatus.SOLD:
days_since_sale = (datetime.now() - .listing_date).days
days_since_sale > :
distance = ._calculate_distance(
subject_property.coordinates,
.coordinates
)
distance > radius_miles:
size_diff = (.square_feet - subject_property.square_feet)
size_diff_pct = size_diff / subject_property.square_feet
size_diff_pct > :
(.bedrooms - subject_property.bedrooms) > :
comparables.append()
comparables:
{: }
prices = [(p.listing_price) p comparables]
price_per_sqft_values = [
(.calculate_price_per_sqft(p)) p comparables
]
avg_price = (prices) / (prices)
avg_price_per_sqft = (price_per_sqft_values) / (price_per_sqft_values)
estimated_value = avg_price_per_sqft * subject_property.square_feet
{
: subject_property.property_id,
: (comparables),
: [
{
: p.property_id,
: p.address,
: (p.listing_price),
: p.square_feet,
: (.calculate_price_per_sqft(p))
}
p comparables[:]
],
: {
: avg_price,
: avg_price_per_sqft,
: (prices),
: (prices)
},
: estimated_value,
: estimated_value *
}
() -> :
search_id = ._generate_search_id()
.saved_searches[search_id] = {
: user_id,
: search_criteria,
: datetime.now(),
:
}
search_id
() -> :
math radians, sin, cos, sqrt, atan2
lat1, lon1 = radians(coord1[]), radians(coord1[])
lat2, lon2 = radians(coord2[]), radians(coord2[])
dlat = lat2 - lat1
dlon = lon2 - lon1
a = sin(dlat/)** + cos(lat1) * cos(lat2) * sin(dlon/)**
c = * atan2(sqrt(a), sqrt(-a))
radius_miles =
distance = radius_miles * c
distance
() -> []:
conflicts = []
showing .showings:
showing.property_id != property_id:
showing.status == :
time_diff = ((showing.requested_date - requested_date).total_seconds() / )
time_diff < :
conflicts.append({
: showing.showing_id,
: showing.requested_date.isoformat()
})
conflicts
():
():
() -> :
uuid
() -> :
uuid
() -> :
uuid
() -> :
uuid
Property Valuation and Analytics
import numpy as np
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.preprocessing import StandardScaler
class PropertyValuationSystem:
"""AI-powered property valuation"""
def __init__(self):
self.model = GradientBoostingRegressor(n_estimators=100)
self.scaler = StandardScaler()
self.trained = False
def train_model(self, training_data: List[dict]):
"""Train valuation model on historical data"""
features = []
prices = []
for property_data in training_data:
feature_vector = self._extract_features(property_data)
features.append(feature_vector)
prices.append(property_data['sold_price'])
X = np.array(features)
y = np.array(prices)
X_scaled = self.scaler.fit_transform(X)
self.model.fit(X_scaled, y)
self.trained = True
def estimate_value(self, property_data: dict) -> dict:
"""Estimate property value"""
if not self.trained:
{: }
features = ._extract_features(property_data)
features_scaled = .scaler.transform([features])
estimated_value = .model.predict(features_scaled)[]
confidence_range = estimated_value *
{
: estimated_value,
: {
: estimated_value - confidence_range,
: estimated_value + confidence_range
},
: estimated_value / property_data[]
}
() -> []:
[
property_data[],
property_data[],
property_data[],
property_data[],
property_data[],
property_data.get(, ),
property_data.get(, ),
property_data.get(, ) ,
property_data.get(, ) ,
property_data.get(, )
]
:
() -> :
sales_data:
{: }
prices = [s[] s sales_data]
days_on_market = [s[] s sales_data]
median_price = np.median(prices)
avg_price = np.mean(prices)
avg_days_on_market = np.mean(days_on_market)
recent_data = sales_data[-:]
older_data = sales_data[-:-]
(recent_data) > (older_data) > :
recent_avg = np.mean([s[] s recent_data])
older_avg = np.mean([s[] s older_data])
price_change = ((recent_avg - older_avg) / older_avg) *
:
price_change =
avg_days_on_market < :
market_health =
avg_days_on_market < :
market_health =
:
market_health =
{
: median_price,
: avg_price,
: avg_days_on_market,
: price_change,
: market_health,
: (sales_data)
}
() -> :
total_listings = (active_listings)
avg_price = np.mean([(p.listing_price) p active_listings])
months_of_inventory =
{
: total_listings,
: avg_price,
: months_of_inventory,
: <= months_of_inventory <=
months_of_inventory <
}
Lease Management
@dataclass
class Lease:
"""Rental lease agreement"""
lease_id: str
property_id: str
tenant_name: str
tenant_contact: dict
start_date: datetime
end_date: datetime
monthly_rent: Decimal
security_deposit: Decimal
status: str
auto_renew: bool
@dataclass
class MaintenanceRequest:
"""Maintenance request for property"""
request_id: str
property_id: str
tenant_name: str
category: str
priority: str
description: str
submitted_date: datetime
status: str
assigned_to: Optional[str]
class PropertyManagementSystem:
"""Property management for landlords and property managers"""
def __init__(self):
self.leases = {}
self.maintenance_requests = []
self.rent_payments = []
def create_lease(self, lease_data: dict) -> Lease:
"""Create new lease agreement"""
lease_id = self._generate_lease_id()
lease = Lease(
lease_id=lease_id,
property_id=lease_data[],
tenant_name=lease_data[],
tenant_contact=lease_data[],
start_date=lease_data[],
end_date=lease_data[],
monthly_rent=Decimal((lease_data[])),
security_deposit=Decimal((lease_data[])),
status=,
auto_renew=lease_data.get(, )
)
.leases[lease_id] = lease
._schedule_rent_reminders(lease)
lease
() -> :
lease = .leases.get(lease_id)
lease:
{: }
payment = {
: ._generate_payment_id(),
: lease_id,
: amount,
: payment_date,
: payment_method,
: payment_date.strftime()
}
.rent_payments.append(payment)
expected_date = datetime(payment_date.year, payment_date.month, )
days_late = (payment_date - expected_date).days
{
: ,
: payment[],
: (, days_late),
: ._calculate_late_fee(lease, days_late)
}
() -> MaintenanceRequest:
request = MaintenanceRequest(
request_id=._generate_request_id(),
property_id=request_data[],
tenant_name=request_data[],
category=request_data[],
priority=request_data.get(, ),
description=request_data[],
submitted_date=datetime.now(),
status=,
assigned_to=
)
.maintenance_requests.append(request)
request.priority == :
._assign_emergency_maintenance(request)
request
() -> []:
expiring_soon = []
current_date = datetime.now()
lease .leases.values():
lease.status != :
days_until_expiration = (lease.end_date - current_date).days
< days_until_expiration <= :
expiring_soon.append({
: lease.lease_id,
: lease.property_id,
: lease.tenant_name,
: lease.end_date.isoformat(),
: days_until_expiration,
: lease.auto_renew
})
expiring_soon
() -> Decimal:
days_late <= :
Decimal()
late_fee = Decimal() + (Decimal() * (days_late - ))
late_fee
():
():
() -> :
uuid
() -> :
uuid
() -> :
uuid
Best Practices
Listing Management
- Use high-quality professional photos
- Write compelling property descriptions
- Include virtual tours and 3D walkthroughs
- Update listings immediately when status changes
- Respond to inquiries within 1 hour
- Maintain accurate MLS data
- Use targeted marketing campaigns
Property Valuation
- Use multiple valuation methods (CMA, AVM, appraisal)
- Consider local market conditions
- Account for property condition and upgrades
- Review comparable sales regularly
- Factor in seasonal trends
- Include neighborhood analysis
- Document valuation methodology
Lease Management
- Use standardized lease templates
- Conduct thorough tenant screening
- Document property condition (move-in/move-out)
- Maintain security deposit in separate account
- Schedule regular property inspections
- Respond to maintenance requests promptly
- Maintain clear communication with tenants
Compliance
- Follow Fair Housing Act requirements
- Maintain proper licensing
- Use compliant lease agreements
- Protect tenant privacy
- Follow eviction procedures properly
- Maintain insurance coverage
- Keep accurate financial records
Anti-Patterns
❌ Poor quality listing photos
❌ Inaccurate property information
❌ Slow response to inquiries
❌ No virtual tour options
❌ Ignoring online reviews
❌ Manual document management
❌ No tenant screening process
❌ Poor maintenance tracking
❌ Inadequate insurance coverage
Resources