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.
- {blocket_api-0.5.2 → blocket_api-0.5.3}/PKG-INFO +10 -10
- {blocket_api-0.5.2 → blocket_api-0.5.3}/README.md +1 -1
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api/ad_parser.py +4 -5
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api/async_blocket.py +1 -3
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api/blocket.py +0 -2
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api.egg-info/PKG-INFO +10 -10
- blocket_api-0.5.3/blocket_api.egg-info/requires.txt +13 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/pyproject.toml +12 -9
- blocket_api-0.5.2/blocket_api.egg-info/requires.txt +0 -13
- {blocket_api-0.5.2 → blocket_api-0.5.3}/LICENSE +0 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api/__init__.py +6 -6
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api/_params.py +0 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api/constants.py +0 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api.egg-info/SOURCES.txt +0 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api.egg-info/dependency_links.txt +0 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/blocket_api.egg-info/top_level.txt +0 -0
- {blocket_api-0.5.2 → blocket_api-0.5.3}/setup.cfg +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blocket_api
|
|
3
|
-
Version: 0.5.
|
|
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.
|
|
10
|
+
Requires-Dist: beautifulsoup4>=4.15.0
|
|
11
11
|
Provides-Extra: dev
|
|
12
|
-
Requires-Dist: pre-commit>=4.
|
|
13
|
-
Requires-Dist: pytest>=9.
|
|
14
|
-
Requires-Dist: pytest-asyncio>=
|
|
15
|
-
Requires-Dist: respx>=0.
|
|
16
|
-
Requires-Dist: mypy>=
|
|
17
|
-
Requires-Dist: ruff>=0.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
112
|
-
|
|
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",
|
|
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, *_:
|
|
44
|
+
async def __aexit__(self, *_: object) -> None:
|
|
47
45
|
await self.aclose()
|
|
48
46
|
|
|
49
47
|
async def aclose(self) -> None:
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blocket_api
|
|
3
|
-
Version: 0.5.
|
|
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.
|
|
10
|
+
Requires-Dist: beautifulsoup4>=4.15.0
|
|
11
11
|
Provides-Extra: dev
|
|
12
|
-
Requires-Dist: pre-commit>=4.
|
|
13
|
-
Requires-Dist: pytest>=9.
|
|
14
|
-
Requires-Dist: pytest-asyncio>=
|
|
15
|
-
Requires-Dist: respx>=0.
|
|
16
|
-
Requires-Dist: mypy>=
|
|
17
|
-
Requires-Dist: ruff>=0.
|
|
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.
|
|
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
|
|
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
|
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "blocket_api"
|
|
3
|
-
version = "0.5.
|
|
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.
|
|
10
|
+
"beautifulsoup4>=4.15.0",
|
|
11
11
|
]
|
|
12
12
|
|
|
13
13
|
[project.optional-dependencies]
|
|
14
14
|
dev = [
|
|
15
|
-
"pre-commit>=4.
|
|
16
|
-
"pytest>=9.
|
|
17
|
-
"pytest-asyncio>=
|
|
18
|
-
"respx>=0.
|
|
19
|
-
"mypy>=
|
|
20
|
-
"ruff>=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.
|
|
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"]
|
|
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
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"RecommerceAd",
|
|
33
|
+
"Location",
|
|
34
|
+
"McAd",
|
|
37
35
|
"McModel",
|
|
38
36
|
"McSortOrder",
|
|
39
37
|
"McType",
|
|
40
|
-
"
|
|
38
|
+
"RecommerceAd",
|
|
39
|
+
"SortOrder",
|
|
40
|
+
"SubCategory",
|
|
41
41
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|