blocket-api 0.3.94__tar.gz → 0.4.0__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.
- {blocket_api-0.3.94 → blocket_api-0.4.0}/PKG-INFO +2 -2
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api/ad_parser.py +2 -2
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api/blocket.py +5 -5
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api.egg-info/PKG-INFO +2 -2
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api.egg-info/requires.txt +1 -1
- {blocket_api-0.3.94 → blocket_api-0.4.0}/pyproject.toml +2 -2
- {blocket_api-0.3.94 → blocket_api-0.4.0}/LICENSE +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/README.md +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api/__init__.py +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api/constants.py +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api.egg-info/SOURCES.txt +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api.egg-info/dependency_links.txt +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/blocket_api.egg-info/top_level.txt +0 -0
- {blocket_api-0.3.94 → blocket_api-0.4.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blocket_api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A python API wrapper for blocket.se
|
|
5
5
|
Author-email: dunderrrrrr <emil.bjorkroth@gmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -17,7 +17,7 @@ Requires-Dist: mkdocs-material>=9.6.21
|
|
|
17
17
|
Requires-Dist: mkdocs-swagger-ui-tag>=0.7.2
|
|
18
18
|
Requires-Dist: websockets>=15.0.1
|
|
19
19
|
Requires-Dist: beautifulsoup4>=4.14.2
|
|
20
|
-
Requires-Dist: ruff>=0.14.
|
|
20
|
+
Requires-Dist: ruff>=0.14.10
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
@@ -17,7 +17,7 @@ class RecommerceAd:
|
|
|
17
17
|
def url(self) -> str:
|
|
18
18
|
return f"{SITE_URL}/recommerce/forsale/item/{self.id}"
|
|
19
19
|
|
|
20
|
-
def parse(self, response: Response) -> Any:
|
|
20
|
+
def parse(self, response: Response) -> dict[str, Any]:
|
|
21
21
|
soup = BeautifulSoup(response.content, "html.parser")
|
|
22
22
|
json_script_tag = soup.select_one(
|
|
23
23
|
'script:-soup-contains("window.__staticRouterHydrationData")'
|
|
@@ -41,7 +41,7 @@ class MobilityAd:
|
|
|
41
41
|
def url(self) -> str:
|
|
42
42
|
return f"{SITE_URL}/mobility/item/{self.id}"
|
|
43
43
|
|
|
44
|
-
def parse(self, response: Response) -> dict:
|
|
44
|
+
def parse(self, response: Response) -> dict[str, Any]:
|
|
45
45
|
soup = BeautifulSoup(response.content, "html.parser")
|
|
46
46
|
grid = soup.find("div", class_="grid grid-cols-1 md:grid-cols-3 md:gap-x-32")
|
|
47
47
|
|
|
@@ -52,11 +52,11 @@ class BlocketAPI:
|
|
|
52
52
|
locations: list[Location] = [],
|
|
53
53
|
category: Category | None = None,
|
|
54
54
|
sub_category: SubCategory | None = None,
|
|
55
|
-
) -> Any:
|
|
55
|
+
) -> dict[str, Any]:
|
|
56
56
|
if category and sub_category:
|
|
57
57
|
raise AssertionError("Cannot specify both category and sub_categories")
|
|
58
58
|
|
|
59
|
-
url = f"{SITE_URL}/recommerce
|
|
59
|
+
url = f"{SITE_URL}/recommerce/forsale/search/api/search/SEARCH_ID_BAP_COMMON"
|
|
60
60
|
|
|
61
61
|
param_dict: dict[str, str | int | None] = {
|
|
62
62
|
"q": query,
|
|
@@ -88,7 +88,7 @@ class BlocketAPI:
|
|
|
88
88
|
milage_to: int | None = None,
|
|
89
89
|
colors: list[CarColor] = [],
|
|
90
90
|
transmissions: list[CarTransmission] = [],
|
|
91
|
-
) -> Any:
|
|
91
|
+
) -> dict[str, Any]:
|
|
92
92
|
url = f"{SITE_URL}/mobility/search/api/search/SEARCH_ID_CAR_USED"
|
|
93
93
|
|
|
94
94
|
param_dict: dict[str, str | int | None] = {
|
|
@@ -158,7 +158,7 @@ class BlocketAPI:
|
|
|
158
158
|
price_to: int | None = None,
|
|
159
159
|
engine_volume_from: int | None = None,
|
|
160
160
|
engine_volume_to: int | None = None,
|
|
161
|
-
) -> Any:
|
|
161
|
+
) -> dict[str, Any]:
|
|
162
162
|
url = f"{SITE_URL}/mobility/search/api/search/SEARCH_ID_MC_USED"
|
|
163
163
|
|
|
164
164
|
param_dict: dict[str, str | int | None] = {
|
|
@@ -179,6 +179,6 @@ class BlocketAPI:
|
|
|
179
179
|
|
|
180
180
|
return _request(url=url, params=params).json()
|
|
181
181
|
|
|
182
|
-
def get_ad(self, ad: RecommerceAd | CarAd | BoatAd | McAd) -> dict:
|
|
182
|
+
def get_ad(self, ad: RecommerceAd | CarAd | BoatAd | McAd) -> dict[str, Any]:
|
|
183
183
|
response = _request(url=ad.url, params=[])
|
|
184
184
|
return ad.parse(response)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blocket_api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A python API wrapper for blocket.se
|
|
5
5
|
Author-email: dunderrrrrr <emil.bjorkroth@gmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -17,7 +17,7 @@ Requires-Dist: mkdocs-material>=9.6.21
|
|
|
17
17
|
Requires-Dist: mkdocs-swagger-ui-tag>=0.7.2
|
|
18
18
|
Requires-Dist: websockets>=15.0.1
|
|
19
19
|
Requires-Dist: beautifulsoup4>=4.14.2
|
|
20
|
-
Requires-Dist: ruff>=0.14.
|
|
20
|
+
Requires-Dist: ruff>=0.14.10
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
<p align="center">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "blocket_api"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "A python API wrapper for blocket.se"
|
|
5
5
|
authors = [{name = "dunderrrrrr", email = "emil.bjorkroth@gmail.com"}]
|
|
6
6
|
readme = "README.md"
|
|
@@ -17,7 +17,7 @@ dependencies = [
|
|
|
17
17
|
"mkdocs-swagger-ui-tag>=0.7.2",
|
|
18
18
|
"websockets>=15.0.1",
|
|
19
19
|
"beautifulsoup4>=4.14.2",
|
|
20
|
-
"ruff>=0.14.
|
|
20
|
+
"ruff>=0.14.10",
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|