blocket-api 0.5.2__tar.gz → 0.5.3__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,23 +1,23 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blocket_api
3
- Version: 0.5.2
3
+ Version: 0.5.3
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
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
9
  Requires-Dist: httpx>=0.28.1
10
- Requires-Dist: beautifulsoup4>=4.14.3
10
+ Requires-Dist: beautifulsoup4>=4.15.0
11
11
  Provides-Extra: dev
12
- Requires-Dist: pre-commit>=4.5.1; extra == "dev"
13
- Requires-Dist: pytest>=9.0.2; extra == "dev"
14
- Requires-Dist: pytest-asyncio>=0.26.0; extra == "dev"
15
- Requires-Dist: respx>=0.22.0; extra == "dev"
16
- Requires-Dist: mypy>=1.19.1; extra == "dev"
17
- Requires-Dist: ruff>=0.9.0; extra == "dev"
12
+ Requires-Dist: pre-commit>=4.6.2; extra == "dev"
13
+ Requires-Dist: pytest>=9.1.1; extra == "dev"
14
+ Requires-Dist: pytest-asyncio>=1.4.0; extra == "dev"
15
+ Requires-Dist: respx>=0.23.1; extra == "dev"
16
+ Requires-Dist: mypy>=2.3.1; extra == "dev"
17
+ Requires-Dist: ruff>=0.16.6; extra == "dev"
18
18
  Requires-Dist: flask>=3.1.3; extra == "dev"
19
19
  Requires-Dist: htpy>=26.5.1; extra == "dev"
20
- Requires-Dist: gunicorn>=26.0.0; extra == "dev"
20
+ Requires-Dist: gunicorn>=26.2.0; extra == "dev"
21
21
  Dynamic: license-file
22
22
 
23
23
  # BlocketAPI
@@ -26,7 +26,7 @@ Dynamic: license-file
26
26
 
27
27
  BlocketAPI allows users to search [blocket.se](https://blocket.se/) for ads.
28
28
 
29
- > Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach and user-friendly interface, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.
29
+ > Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach ~~and user-friendly interface~~, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.
30
30
 
31
31
  ## 🧑‍💻️ Install
32
32
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  BlocketAPI allows users to search [blocket.se](https://blocket.se/) for ads.
6
6
 
7
- > Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach and user-friendly interface, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.
7
+ > Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach ~~and user-friendly interface~~, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.
8
8
 
9
9
  ## 🧑‍💻️ Install
10
10
 
@@ -100,7 +100,7 @@ class MobilityAd:
100
100
  return
101
101
 
102
102
  def _extract_specifications(self, grid: Tag, data: dict) -> None:
103
- specs_section = grid.find("section", class_="key-info-section")
103
+ specs_section = grid.find("section", class_=lambda x: x and "key-info" in x)
104
104
  if not specs_section:
105
105
  return
106
106
  dl = specs_section.find("dl")
@@ -108,9 +108,8 @@ class MobilityAd:
108
108
  return
109
109
 
110
110
  specifications = {}
111
- for div in dl.find_all("div", style="break-inside:avoid-column"):
112
- dt = div.find("dt")
113
- dd = div.find("dd")
111
+ for dt in dl.find_all("dt"):
112
+ dd = dt.find_next_sibling("dd")
114
113
  if dt and dd:
115
114
  specifications[dt.get_text(strip=True)] = dd.get_text(strip=True)
116
115
 
@@ -193,7 +192,7 @@ class McAd(MobilityAd):
193
192
 
194
193
  def extend(self, data: dict, soup: BeautifulSoup, grid: Tag) -> None:
195
194
  if place_h2 := soup.find(
196
- "h2", text=lambda t: isinstance(t, NavigableString) and "Plats" in t
195
+ "h2", string=lambda t: isinstance(t, NavigableString) and "Plats" in t
197
196
  ):
198
197
  if link := place_h2.find_parent():
199
198
  data["location"] = link.get_text(strip=True)
@@ -17,8 +17,6 @@ from .constants import (
17
17
  HEADERS,
18
18
  MC_SEARCH_URL,
19
19
  SEARCH_URL,
20
- )
21
- from .constants import (
22
20
  BoatType,
23
21
  CarColor,
24
22
  CarModel,
@@ -43,7 +41,7 @@ class AsyncBlocketAPI:
43
41
  async def __aenter__(self) -> AsyncBlocketAPI:
44
42
  return self
45
43
 
46
- async def __aexit__(self, *_: Any) -> None:
44
+ async def __aexit__(self, *_: object) -> None:
47
45
  await self.aclose()
48
46
 
49
47
  async def aclose(self) -> None:
@@ -18,8 +18,6 @@ from .constants import (
18
18
  HEADERS,
19
19
  MC_SEARCH_URL,
20
20
  SEARCH_URL,
21
- )
22
- from .constants import (
23
21
  BoatType,
24
22
  CarColor,
25
23
  CarModel,
@@ -1,23 +1,23 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blocket_api
3
- Version: 0.5.2
3
+ Version: 0.5.3
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
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
9
  Requires-Dist: httpx>=0.28.1
10
- Requires-Dist: beautifulsoup4>=4.14.3
10
+ Requires-Dist: beautifulsoup4>=4.15.0
11
11
  Provides-Extra: dev
12
- Requires-Dist: pre-commit>=4.5.1; extra == "dev"
13
- Requires-Dist: pytest>=9.0.2; extra == "dev"
14
- Requires-Dist: pytest-asyncio>=0.26.0; extra == "dev"
15
- Requires-Dist: respx>=0.22.0; extra == "dev"
16
- Requires-Dist: mypy>=1.19.1; extra == "dev"
17
- Requires-Dist: ruff>=0.9.0; extra == "dev"
12
+ Requires-Dist: pre-commit>=4.6.2; extra == "dev"
13
+ Requires-Dist: pytest>=9.1.1; extra == "dev"
14
+ Requires-Dist: pytest-asyncio>=1.4.0; extra == "dev"
15
+ Requires-Dist: respx>=0.23.1; extra == "dev"
16
+ Requires-Dist: mypy>=2.3.1; extra == "dev"
17
+ Requires-Dist: ruff>=0.16.6; extra == "dev"
18
18
  Requires-Dist: flask>=3.1.3; extra == "dev"
19
19
  Requires-Dist: htpy>=26.5.1; extra == "dev"
20
- Requires-Dist: gunicorn>=26.0.0; extra == "dev"
20
+ Requires-Dist: gunicorn>=26.2.0; extra == "dev"
21
21
  Dynamic: license-file
22
22
 
23
23
  # BlocketAPI
@@ -26,7 +26,7 @@ Dynamic: license-file
26
26
 
27
27
  BlocketAPI allows users to search [blocket.se](https://blocket.se/) for ads.
28
28
 
29
- > Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach and user-friendly interface, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.
29
+ > Blocket is one of Sweden's largest online marketplaces. It was founded in 1996 and allows users to buy and sell a wide range of items, including cars, real estate, jobs, services, and second-hand goods. The platform is known for its extensive reach ~~and user-friendly interface~~, making it a popular choice for Swedes looking to purchase or sell items quickly and efficiently.
30
30
 
31
31
  ## 🧑‍💻️ Install
32
32
 
@@ -0,0 +1,13 @@
1
+ httpx>=0.28.1
2
+ beautifulsoup4>=4.15.0
3
+
4
+ [dev]
5
+ pre-commit>=4.6.2
6
+ pytest>=9.1.1
7
+ pytest-asyncio>=1.4.0
8
+ respx>=0.23.1
9
+ mypy>=2.3.1
10
+ ruff>=0.16.6
11
+ flask>=3.1.3
12
+ htpy>=26.5.1
13
+ gunicorn>=26.2.0
@@ -1,26 +1,26 @@
1
1
  [project]
2
2
  name = "blocket_api"
3
- version = "0.5.2"
3
+ version = "0.5.3"
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"
7
7
  requires-python = ">=3.10"
8
8
  dependencies = [
9
9
  "httpx>=0.28.1",
10
- "beautifulsoup4>=4.14.3",
10
+ "beautifulsoup4>=4.15.0",
11
11
  ]
12
12
 
13
13
  [project.optional-dependencies]
14
14
  dev = [
15
- "pre-commit>=4.5.1",
16
- "pytest>=9.0.2",
17
- "pytest-asyncio>=0.26.0",
18
- "respx>=0.22.0",
19
- "mypy>=1.19.1",
20
- "ruff>=0.9.0",
15
+ "pre-commit>=4.6.2",
16
+ "pytest>=9.1.1",
17
+ "pytest-asyncio>=1.4.0",
18
+ "respx>=0.23.1",
19
+ "mypy>=2.3.1",
20
+ "ruff>=0.16.6",
21
21
  "flask>=3.1.3",
22
22
  "htpy>=26.5.1",
23
- "gunicorn>=26.0.0",
23
+ "gunicorn>=26.2.0",
24
24
  ]
25
25
 
26
26
 
@@ -29,3 +29,6 @@ testpaths = [
29
29
  "tests/*",
30
30
  ]
31
31
  asyncio_mode = "auto"
32
+
33
+ [tool.ruff.lint]
34
+ ignore = ["B006", "RUF012", "SIM102", "PYI034"]
@@ -1,13 +0,0 @@
1
- httpx>=0.28.1
2
- beautifulsoup4>=4.14.3
3
-
4
- [dev]
5
- pre-commit>=4.5.1
6
- pytest>=9.0.2
7
- pytest-asyncio>=0.26.0
8
- respx>=0.22.0
9
- mypy>=1.19.1
10
- ruff>=0.9.0
11
- flask>=3.1.3
12
- htpy>=26.5.1
13
- gunicorn>=26.0.0
File without changes
@@ -20,22 +20,22 @@ from .constants import (
20
20
  __all__ = [
21
21
  "AsyncBlocketAPI",
22
22
  "BlocketAPI",
23
- "Location",
24
23
  "BoatAd",
25
- "CarAd",
26
24
  "BoatSortOrder",
27
25
  "BoatType",
26
+ "CarAd",
28
27
  "CarColor",
29
28
  "CarModel",
30
29
  "CarSortOrder",
31
30
  "CarTransmission",
32
31
  "CarWheelDrive",
33
32
  "Category",
34
- "SortOrder",
35
- "SubCategory",
36
- "RecommerceAd",
33
+ "Location",
34
+ "McAd",
37
35
  "McModel",
38
36
  "McSortOrder",
39
37
  "McType",
40
- "McAd",
38
+ "RecommerceAd",
39
+ "SortOrder",
40
+ "SubCategory",
41
41
  ]
File without changes