pyfunda 2.5.0__tar.gz → 2.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyfunda-2.6.1/.dockerignore +6 -0
- pyfunda-2.6.1/Dockerfile +13 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/PKG-INFO +1 -1
- {pyfunda-2.5.0 → pyfunda-2.6.1}/funda/funda.py +43 -1
- {pyfunda-2.5.0 → pyfunda-2.6.1}/pyproject.toml +1 -1
- {pyfunda-2.5.0 → pyfunda-2.6.1}/.github/FUNDING.yml +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/.github/workflows/publish.yml +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/.gitignore +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/LICENSE +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/README.md +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/analysis.ipynb +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/export_to_csv.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/new_listings_alert.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/poll_new_listings.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/price_history.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/price_tracker.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/examples/search_sold.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/funda/__init__.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/funda/listing.py +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/funda/py.typed +0 -0
- {pyfunda-2.5.0 → pyfunda-2.6.1}/test_all_flows.py +0 -0
pyfunda-2.6.1/Dockerfile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
FROM ghcr.io/astral-sh/uv:0.6.6-python3.12-bookworm-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
COPY pyproject.toml uv.lock ./
|
|
6
|
+
RUN uv sync --frozen --no-install-project --no-cache
|
|
7
|
+
|
|
8
|
+
COPY . .
|
|
9
|
+
RUN uv sync --frozen --no-cache
|
|
10
|
+
|
|
11
|
+
ENV PATH="/app/.venv/bin:$PATH"
|
|
12
|
+
|
|
13
|
+
CMD ["bash"]
|
|
@@ -324,6 +324,9 @@ class Funda:
|
|
|
324
324
|
plot_max: int | None = None,
|
|
325
325
|
object_type: list[str] | None = None,
|
|
326
326
|
energy_label: list[str] | None = None,
|
|
327
|
+
construction_type: str | list[str] | None = None,
|
|
328
|
+
construction_year_min: int | None = None,
|
|
329
|
+
construction_year_max: int | None = None,
|
|
327
330
|
radius_km: int | None = None,
|
|
328
331
|
sort: str | None = None,
|
|
329
332
|
page: int = 0,
|
|
@@ -343,6 +346,9 @@ class Funda:
|
|
|
343
346
|
plot_max: Maximum plot area in m²
|
|
344
347
|
object_type: Property types (e.g. ["house", "apartment"])
|
|
345
348
|
energy_label: Energy labels (e.g. ["A", "A+", "A++"])
|
|
349
|
+
construction_type: "resale" or "newly_built", or a list of both
|
|
350
|
+
construction_year_min: Minimum construction year (maps to Funda periods)
|
|
351
|
+
construction_year_max: Maximum construction year (maps to Funda periods)
|
|
346
352
|
radius_km: Search radius in km (use with single location/postcode)
|
|
347
353
|
sort: Sort order - "newest", "oldest", "price_asc", "price_desc",
|
|
348
354
|
"area_asc", "area_desc", "plot_desc", "city", "postcode", or None
|
|
@@ -415,7 +421,7 @@ class Funda:
|
|
|
415
421
|
"path": f"area_with_radius.{actual_radius}",
|
|
416
422
|
}
|
|
417
423
|
elif locations:
|
|
418
|
-
params["selected_area"] = locations
|
|
424
|
+
params["selected_area"] = [loc.lower() for loc in locations]
|
|
419
425
|
|
|
420
426
|
# Price filter - format depends on offering type
|
|
421
427
|
if price_min is not None or price_max is not None:
|
|
@@ -449,6 +455,41 @@ class Funda:
|
|
|
449
455
|
if energy_label:
|
|
450
456
|
params["energy_label"] = energy_label
|
|
451
457
|
|
|
458
|
+
# Construction type filter
|
|
459
|
+
if construction_type:
|
|
460
|
+
if isinstance(construction_type, str):
|
|
461
|
+
params["construction_type"] = [construction_type]
|
|
462
|
+
else:
|
|
463
|
+
params["construction_type"] = list(construction_type)
|
|
464
|
+
|
|
465
|
+
# Construction year filter (mapped to Funda's predefined periods)
|
|
466
|
+
if construction_year_min is not None or construction_year_max is not None:
|
|
467
|
+
period_boundaries = [1906, 1931, 1945, 1960, 1971, 1981, 1991, 2001, 2011, 2021]
|
|
468
|
+
all_periods = (
|
|
469
|
+
["before_1906"]
|
|
470
|
+
+ [f"from_{period_boundaries[i]}_to_{period_boundaries[i+1]-1}" for i in range(len(period_boundaries) - 1)]
|
|
471
|
+
+ ["after_2020"]
|
|
472
|
+
)
|
|
473
|
+
# Map each period to its year range for filtering
|
|
474
|
+
period_ranges = {
|
|
475
|
+
"before_1906": (0, 1905),
|
|
476
|
+
"from_1906_to_1930": (1906, 1930),
|
|
477
|
+
"from_1931_to_1944": (1931, 1944),
|
|
478
|
+
"from_1945_to_1959": (1945, 1959),
|
|
479
|
+
"from_1960_to_1970": (1960, 1970),
|
|
480
|
+
"from_1971_to_1980": (1971, 1980),
|
|
481
|
+
"from_1981_to_1990": (1981, 1990),
|
|
482
|
+
"from_1991_to_2000": (1991, 2000),
|
|
483
|
+
"from_2001_to_2010": (2001, 2010),
|
|
484
|
+
"from_2011_to_2020": (2011, 2020),
|
|
485
|
+
"after_2020": (2021, 9999),
|
|
486
|
+
}
|
|
487
|
+
year_min = construction_year_min or 0
|
|
488
|
+
year_max = construction_year_max or 9999
|
|
489
|
+
selected = [p for p in all_periods if period_ranges[p][1] >= year_min and period_ranges[p][0] <= year_max]
|
|
490
|
+
if selected:
|
|
491
|
+
params["construction_period"] = selected
|
|
492
|
+
|
|
452
493
|
# Build NDJSON query
|
|
453
494
|
index_line = json.dumps({"index": "listings-wonen-searcher-alias-prod"})
|
|
454
495
|
query_line = json.dumps({"id": "search_result_20250805", "params": params})
|
|
@@ -792,6 +833,7 @@ class Funda:
|
|
|
792
833
|
"postcode": address.get("postal_code"),
|
|
793
834
|
"province": address.get("province"),
|
|
794
835
|
"neighbourhood": address.get("neighbourhood"),
|
|
836
|
+
"wijk": address.get("wijk"),
|
|
795
837
|
"price": price,
|
|
796
838
|
"price_condition": price_condition,
|
|
797
839
|
"living_area": source.get("floor_area", [None])[0] if source.get("floor_area") else None,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|