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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blocket_api
3
- Version: 0.3.94
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.7
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-search-page/api/search/SEARCH_ID_BAP_COMMON"
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.94
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.7
20
+ Requires-Dist: ruff>=0.14.10
21
21
  Dynamic: license-file
22
22
 
23
23
  <p align="center">
@@ -9,4 +9,4 @@ mkdocs-material>=9.6.21
9
9
  mkdocs-swagger-ui-tag>=0.7.2
10
10
  websockets>=15.0.1
11
11
  beautifulsoup4>=4.14.2
12
- ruff>=0.14.7
12
+ ruff>=0.14.10
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "blocket_api"
3
- version = "0.3.94"
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.7",
20
+ "ruff>=0.14.10",
21
21
  ]
22
22
 
23
23
 
File without changes
File without changes
File without changes