-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon_class.py
More file actions
36 lines (31 loc) · 1.04 KB
/
common_class.py
File metadata and controls
36 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import logging
from dataclasses import dataclass, field
from enum import Enum
from typing import List, Optional
# Set up logging configuration
logging.basicConfig(level=logging.INFO)
class SearchMode(Enum):
"""
Enumeration of different search modes with varying weights
for different property attributes.
"""
BALANCED = "balanced"
VISUAL_FOCUS = "visual_focus"
FEATURES_FOCUS = "features_focus"
LOCATION_FOCUS = "location_focus"
DESCRIPTION_FOCUS = "description_focus"
BALANCED_WITHOUT_VISUAL = "balanced_without_visual"
@dataclass
class PropertyFilters:
"""
Dataclass representing filters that can be applied to property search results.
"""
min_price: Optional[float] = None
max_price: Optional[float] = None
min_bedrooms: Optional[int] = None
max_bedrooms: Optional[int] = None
min_bathrooms: Optional[int] = None
max_bathrooms: Optional[int] = None
property_type: Optional[str] = None
must_have_amenities: List[str] = field(default_factory=list)
sale_lease: str = ''