From 2bf60974ad584234680ba50b1f03cf5d8ec56d50 Mon Sep 17 00:00:00 2001 From: dunderrrrrr Date: Sat, 25 Apr 2026 20:02:31 +0200 Subject: [PATCH 1/2] chore(vscode): drop workspace file This is no longer in use since I switched to zed. --- ba.code-workspace | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 ba.code-workspace diff --git a/ba.code-workspace b/ba.code-workspace deleted file mode 100644 index 54c5b43..0000000 --- a/ba.code-workspace +++ /dev/null @@ -1,25 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "editor.formatOnSave": true, - "python.formatting.provider": "black", - "editor.defaultFormatter": "ms-python.black-formatter", - "python.testing.autoTestDiscoverOnSaveEnabled": false, - "python.testing.pytestEnabled": true, - "python.linting.mypyEnabled": true, - "python.linting.mypyPath": ".venv/bin/dmypy", - "python.linting.mypyArgs": ["run", "--"], - "python.linting.enabled": true, - "python.linting.flake8Enabled": true, - "python.linting.pylintEnabled": false, - "[python]": { - "editor.codeActionsOnSave": { - "source.organizeImports": "explicit" - } - } - } -} From 88c84cb783b39d6cc297aa8af877b9b7b99c3cc9 Mon Sep 17 00:00:00 2001 From: dunderrrrrr Date: Sat, 25 Apr 2026 20:08:37 +0200 Subject: [PATCH 2/2] feat(car): add horsepower filter This will make it possible to add a hp filter to search_car. Closes https://github.com/dunderrrrrr/blocket_api/issues/67 --- blocket_api/blocket.py | 5 ++++- tests/requests.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/blocket_api/blocket.py b/blocket_api/blocket.py index 7fcbc31..15ce067 100644 --- a/blocket_api/blocket.py +++ b/blocket_api/blocket.py @@ -88,6 +88,8 @@ def search_car( milage_to: int | None = None, colors: list[CarColor] = [], transmissions: list[CarTransmission] = [], + horsepower_from: int | None = None, + horsepower_to: int | None = None, org_id: int | None = None, ) -> dict[str, Any]: url = f"{SITE_URL}/mobility/search/api/search/SEARCH_ID_CAR_USED" @@ -102,12 +104,13 @@ def search_car( "year_to": year_to, "milage_from": milage_from, "milage_to": milage_to, + "engine_effect_from": horsepower_from, + "engine_effect_to": horsepower_to, "orgId": org_id, } params = [QueryParam(k, v) for k, v in param_dict.items() if v is not None] - # Multi-value params params.extend(QueryParam("location", loc.value) for loc in locations) params.extend(QueryParam("make", model.value) for model in models) params.extend(QueryParam("exterior_colour", color.value) for color in colors) diff --git a/tests/requests.py b/tests/requests.py index f82865c..c8c2f6a 100644 --- a/tests/requests.py +++ b/tests/requests.py @@ -123,6 +123,8 @@ def test_search_car(self) -> None: "&price_from=1000" "&price_to=50000" "&transmission=2" + "&engine_effect_from=200" + "&engine_effect_to=300" "&orgId=1337" ) respx.get(expected_url).mock( @@ -134,6 +136,8 @@ def test_search_car(self) -> None: price_from=1000, price_to=50000, transmissions=[CarTransmission.AUTOMATIC], + horsepower_from=200, + horsepower_to=300, org_id=1337, ) assert result == {"status": "ok"} @@ -303,7 +307,7 @@ def test_get_mc_ad(self) -> None:
Motorvolym

150 cc

-
+