Spaces:
Running
Running
Update document_model.py
Browse files- document_model.py +78 -1
document_model.py
CHANGED
@@ -1,2 +1,79 @@
|
|
1 |
-
from typing import List, Optional
|
2 |
from pydantic import BaseModel, ValidationError
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from pydantic import BaseModel, ValidationError
|
2 |
+
from typing import List, Optional
|
3 |
+
|
4 |
+
class Host(BaseModel):
|
5 |
+
host_id: str
|
6 |
+
host_url: str
|
7 |
+
host_name: str
|
8 |
+
host_location: str
|
9 |
+
host_about: str
|
10 |
+
host_response_time: Optional[str] = None
|
11 |
+
host_thumbnail_url: str
|
12 |
+
host_picture_url: str
|
13 |
+
host_response_rate: Optional[int] = None
|
14 |
+
host_is_superhost: bool
|
15 |
+
host_has_profile_pic: bool
|
16 |
+
host_identity_verified: bool
|
17 |
+
|
18 |
+
class Location(BaseModel):
|
19 |
+
type: str
|
20 |
+
coordinates: List[float]
|
21 |
+
is_location_exact: bool
|
22 |
+
|
23 |
+
class Address(BaseModel):
|
24 |
+
street: str
|
25 |
+
government_area: str
|
26 |
+
market: str
|
27 |
+
country: str
|
28 |
+
country_code: str
|
29 |
+
location: Location
|
30 |
+
|
31 |
+
class Review(BaseModel):
|
32 |
+
_id: str
|
33 |
+
date: Optional[datetime] = None
|
34 |
+
listing_id: str
|
35 |
+
reviewer_id: str
|
36 |
+
reviewer_name: Optional[str] = None
|
37 |
+
comments: Optional[str] = None
|
38 |
+
|
39 |
+
class Listing(BaseModel):
|
40 |
+
_id: int
|
41 |
+
listing_url: str
|
42 |
+
name: str
|
43 |
+
summary: str
|
44 |
+
space: str
|
45 |
+
description: str
|
46 |
+
neighborhood_overview: Optional[str] = None
|
47 |
+
notes: Optional[str] = None
|
48 |
+
transit: Optional[str] = None
|
49 |
+
access: str
|
50 |
+
interaction: Optional[str] = None
|
51 |
+
house_rules: str
|
52 |
+
property_type: str
|
53 |
+
room_type: str
|
54 |
+
bed_type: str
|
55 |
+
minimum_nights: int
|
56 |
+
maximum_nights: int
|
57 |
+
cancellation_policy: str
|
58 |
+
last_scraped: Optional[datetime] = None
|
59 |
+
calendar_last_scraped: Optional[datetime] = None
|
60 |
+
first_review: Optional[datetime] = None
|
61 |
+
last_review: Optional[datetime] = None
|
62 |
+
accommodates: int
|
63 |
+
bedrooms: Optional[float] = 0
|
64 |
+
beds: Optional[float] = 0
|
65 |
+
number_of_reviews: int
|
66 |
+
bathrooms: Optional[float] = 0
|
67 |
+
amenities: List[str]
|
68 |
+
price: int
|
69 |
+
security_deposit: Optional[float] = None
|
70 |
+
cleaning_fee: Optional[float] = None
|
71 |
+
extra_people: int
|
72 |
+
guests_included: int
|
73 |
+
images: dict
|
74 |
+
host: Host
|
75 |
+
address: Address
|
76 |
+
availability: dict
|
77 |
+
review_scores: dict
|
78 |
+
reviews: List[Review]
|
79 |
+
text_embeddings: List[float]
|