reuse query params when exporting to immoweb and allow filtering from available date
This commit is contained in:
parent
a23a5ae192
commit
11315359d2
6 changed files with 10207 additions and 42335 deletions
|
|
@ -1,29 +1,11 @@
|
|||
import asyncio
|
||||
from dataclasses import dataclass
|
||||
import pathlib
|
||||
from rec.query import ListingType, listing_query, FurnishType
|
||||
from rec.query import listing_query, QueryParameters
|
||||
from rec.districts import get_districts
|
||||
from data_access import Listing
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class QueryParameters:
|
||||
listing_type: ListingType
|
||||
min_bedrooms: int
|
||||
max_bedrooms: int
|
||||
min_price: int
|
||||
max_price: int
|
||||
district_names: set[str]
|
||||
radius: float = 0
|
||||
page_size: int = 500 # items per page
|
||||
max_days_since_added: int = 30
|
||||
furnish_types: list[FurnishType] | None = None
|
||||
|
||||
# The values below are not supported by rightmove
|
||||
# hence we apply them after fetching
|
||||
# available from; council tax
|
||||
|
||||
|
||||
async def dump_listings(
|
||||
parameters: QueryParameters,
|
||||
data_dir: pathlib.Path = pathlib.Path("data/rs/"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue