aioscrapper 0.1.1__tar.gz → 0.1.2__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.
- {aioscrapper-0.1.1/src/aioscrapper.egg-info → aioscrapper-0.1.2}/PKG-INFO +16 -6
- {aioscrapper-0.1.1 → aioscrapper-0.1.2}/README.md +4 -4
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/scrapper/executor.py +1 -3
- {aioscrapper-0.1.1 → aioscrapper-0.1.2/aioscrapper.egg-info}/PKG-INFO +16 -6
- aioscrapper-0.1.2/aioscrapper.egg-info/SOURCES.txt +27 -0
- aioscrapper-0.1.2/aioscrapper.egg-info/requires.txt +14 -0
- aioscrapper-0.1.2/pyproject.toml +63 -0
- aioscrapper-0.1.2/tests/test_error.py +37 -0
- aioscrapper-0.1.2/tests/test_success.py +29 -0
- aioscrapper-0.1.1/pyproject.toml +0 -24
- aioscrapper-0.1.1/src/aioscrapper.egg-info/SOURCES.txt +0 -25
- aioscrapper-0.1.1/src/aioscrapper.egg-info/requires.txt +0 -2
- {aioscrapper-0.1.1 → aioscrapper-0.1.2}/LICENSE +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/__init__.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/config.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/exceptions.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/helpers.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/pipeline/__init__.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/pipeline/base.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/pipeline/dispatcher.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/scrapper/__init__.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/scrapper/base.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/scrapper/request_manager.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/session/__init__.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/session/aiohttp.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/session/base.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/types/__init__.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/types/middleware.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper/types/session.py +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper.egg-info/dependency_links.txt +0 -0
- {aioscrapper-0.1.1/src → aioscrapper-0.1.2}/aioscrapper.egg-info/top_level.txt +0 -0
- {aioscrapper-0.1.1 → aioscrapper-0.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: aioscrapper
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Async framework for building modular and scalable web scrapers.
|
5
5
|
Author: darkstussy
|
6
6
|
Project-URL: Homepage, https://github.com/darkstussy/aioscrapper
|
@@ -12,18 +12,28 @@ Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
13
13
|
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
14
14
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
15
|
-
Requires-Python: >=3.
|
15
|
+
Requires-Python: >=3.10
|
16
16
|
Description-Content-Type: text/markdown
|
17
17
|
License-File: LICENSE
|
18
18
|
Requires-Dist: aiohttp[speedups]~=3.11.16
|
19
19
|
Requires-Dist: aiojobs~=1.4.0
|
20
|
+
Provides-Extra: dev
|
21
|
+
Requires-Dist: flake8~=7.1.2; extra == "dev"
|
22
|
+
Requires-Dist: black~=25.1.0; extra == "dev"
|
23
|
+
Requires-Dist: pyright~=1.1.399; extra == "dev"
|
24
|
+
Requires-Dist: aiohttp[speedups]~=3.11.16; extra == "dev"
|
25
|
+
Requires-Dist: aiojobs~=1.4.0; extra == "dev"
|
26
|
+
Provides-Extra: test
|
27
|
+
Requires-Dist: pytest~=8.3.5; extra == "test"
|
28
|
+
Requires-Dist: pytest-asyncio~=0.26.0; extra == "test"
|
29
|
+
Requires-Dist: aresponses~=3.0.0; extra == "test"
|
20
30
|
Dynamic: license-file
|
21
31
|
|
22
32
|
# aioscrapper
|
23
33
|
|
24
34
|
**Asynchronous framework for building modular and scalable web scrapers.**
|
25
35
|
|
26
|
-

|
27
37
|

|
28
38
|

|
29
39
|
|
@@ -44,7 +54,7 @@ pip install aioscrapper
|
|
44
54
|
|
45
55
|
## Requirements
|
46
56
|
|
47
|
-
- Python 3.
|
57
|
+
- Python 3.10 or higher
|
48
58
|
- aiohttp
|
49
59
|
- aiojobs
|
50
60
|
|
@@ -53,8 +63,8 @@ pip install aioscrapper
|
|
53
63
|
```python
|
54
64
|
import asyncio
|
55
65
|
|
56
|
-
from aioscrapper import BaseScrapper, AIOScrapper
|
57
|
-
from aioscrapper.types import Response
|
66
|
+
from aioscrapper import BaseScrapper, AIOScrapper
|
67
|
+
from aioscrapper.types import Response, RequestSender
|
58
68
|
|
59
69
|
|
60
70
|
class Scrapper(BaseScrapper):
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
**Asynchronous framework for building modular and scalable web scrapers.**
|
4
4
|
|
5
|
-

|
6
6
|

|
7
7
|

|
8
8
|
|
@@ -23,7 +23,7 @@ pip install aioscrapper
|
|
23
23
|
|
24
24
|
## Requirements
|
25
25
|
|
26
|
-
- Python 3.
|
26
|
+
- Python 3.10 or higher
|
27
27
|
- aiohttp
|
28
28
|
- aiojobs
|
29
29
|
|
@@ -32,8 +32,8 @@ pip install aioscrapper
|
|
32
32
|
```python
|
33
33
|
import asyncio
|
34
34
|
|
35
|
-
from aioscrapper import BaseScrapper, AIOScrapper
|
36
|
-
from aioscrapper.types import Response
|
35
|
+
from aioscrapper import BaseScrapper, AIOScrapper
|
36
|
+
from aioscrapper.types import Response, RequestSender
|
37
37
|
|
38
38
|
|
39
39
|
class Scrapper(BaseScrapper):
|
@@ -32,9 +32,7 @@ class AIOScrapper:
|
|
32
32
|
self._response_middlewares = []
|
33
33
|
|
34
34
|
self._pipelines: dict[str, list[BasePipeline]] = {}
|
35
|
-
self._pipeline_dispatcher = PipelineDispatcher(
|
36
|
-
logger=self._logger.getChild("pipeline"), pipelines=self._pipelines
|
37
|
-
)
|
35
|
+
self._pipeline_dispatcher = PipelineDispatcher(self._logger.getChild("pipeline"), pipelines=self._pipelines)
|
38
36
|
|
39
37
|
def _exception_handler(_, context: dict[str, Any]):
|
40
38
|
if "job" in context:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: aioscrapper
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: Async framework for building modular and scalable web scrapers.
|
5
5
|
Author: darkstussy
|
6
6
|
Project-URL: Homepage, https://github.com/darkstussy/aioscrapper
|
@@ -12,18 +12,28 @@ Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
13
13
|
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
|
14
14
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
15
|
-
Requires-Python: >=3.
|
15
|
+
Requires-Python: >=3.10
|
16
16
|
Description-Content-Type: text/markdown
|
17
17
|
License-File: LICENSE
|
18
18
|
Requires-Dist: aiohttp[speedups]~=3.11.16
|
19
19
|
Requires-Dist: aiojobs~=1.4.0
|
20
|
+
Provides-Extra: dev
|
21
|
+
Requires-Dist: flake8~=7.1.2; extra == "dev"
|
22
|
+
Requires-Dist: black~=25.1.0; extra == "dev"
|
23
|
+
Requires-Dist: pyright~=1.1.399; extra == "dev"
|
24
|
+
Requires-Dist: aiohttp[speedups]~=3.11.16; extra == "dev"
|
25
|
+
Requires-Dist: aiojobs~=1.4.0; extra == "dev"
|
26
|
+
Provides-Extra: test
|
27
|
+
Requires-Dist: pytest~=8.3.5; extra == "test"
|
28
|
+
Requires-Dist: pytest-asyncio~=0.26.0; extra == "test"
|
29
|
+
Requires-Dist: aresponses~=3.0.0; extra == "test"
|
20
30
|
Dynamic: license-file
|
21
31
|
|
22
32
|
# aioscrapper
|
23
33
|
|
24
34
|
**Asynchronous framework for building modular and scalable web scrapers.**
|
25
35
|
|
26
|
-

|
27
37
|

|
28
38
|

|
29
39
|
|
@@ -44,7 +54,7 @@ pip install aioscrapper
|
|
44
54
|
|
45
55
|
## Requirements
|
46
56
|
|
47
|
-
- Python 3.
|
57
|
+
- Python 3.10 or higher
|
48
58
|
- aiohttp
|
49
59
|
- aiojobs
|
50
60
|
|
@@ -53,8 +63,8 @@ pip install aioscrapper
|
|
53
63
|
```python
|
54
64
|
import asyncio
|
55
65
|
|
56
|
-
from aioscrapper import BaseScrapper, AIOScrapper
|
57
|
-
from aioscrapper.types import Response
|
66
|
+
from aioscrapper import BaseScrapper, AIOScrapper
|
67
|
+
from aioscrapper.types import Response, RequestSender
|
58
68
|
|
59
69
|
|
60
70
|
class Scrapper(BaseScrapper):
|
@@ -0,0 +1,27 @@
|
|
1
|
+
LICENSE
|
2
|
+
README.md
|
3
|
+
pyproject.toml
|
4
|
+
aioscrapper/__init__.py
|
5
|
+
aioscrapper/config.py
|
6
|
+
aioscrapper/exceptions.py
|
7
|
+
aioscrapper/helpers.py
|
8
|
+
aioscrapper.egg-info/PKG-INFO
|
9
|
+
aioscrapper.egg-info/SOURCES.txt
|
10
|
+
aioscrapper.egg-info/dependency_links.txt
|
11
|
+
aioscrapper.egg-info/requires.txt
|
12
|
+
aioscrapper.egg-info/top_level.txt
|
13
|
+
aioscrapper/pipeline/__init__.py
|
14
|
+
aioscrapper/pipeline/base.py
|
15
|
+
aioscrapper/pipeline/dispatcher.py
|
16
|
+
aioscrapper/scrapper/__init__.py
|
17
|
+
aioscrapper/scrapper/base.py
|
18
|
+
aioscrapper/scrapper/executor.py
|
19
|
+
aioscrapper/scrapper/request_manager.py
|
20
|
+
aioscrapper/session/__init__.py
|
21
|
+
aioscrapper/session/aiohttp.py
|
22
|
+
aioscrapper/session/base.py
|
23
|
+
aioscrapper/types/__init__.py
|
24
|
+
aioscrapper/types/middleware.py
|
25
|
+
aioscrapper/types/session.py
|
26
|
+
tests/test_error.py
|
27
|
+
tests/test_success.py
|
@@ -0,0 +1,63 @@
|
|
1
|
+
[project]
|
2
|
+
name = "aioscrapper"
|
3
|
+
version = "0.1.2"
|
4
|
+
authors = [{ name = "darkstussy" }, ]
|
5
|
+
description = "Async framework for building modular and scalable web scrapers."
|
6
|
+
readme = "README.md"
|
7
|
+
requires-python = ">=3.10"
|
8
|
+
dependencies = [
|
9
|
+
"aiohttp[speedups]~=3.11.16",
|
10
|
+
"aiojobs~=1.4.0",
|
11
|
+
]
|
12
|
+
classifiers = [
|
13
|
+
"Programming Language :: Python :: 3",
|
14
|
+
"Programming Language :: Python :: 3.12",
|
15
|
+
"Framework :: AsyncIO",
|
16
|
+
"Intended Audience :: Developers",
|
17
|
+
"Operating System :: OS Independent",
|
18
|
+
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
19
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
20
|
+
]
|
21
|
+
|
22
|
+
[project.urls]
|
23
|
+
Homepage = "https://github.com/darkstussy/aioscrapper"
|
24
|
+
Issues = "https://github.com/darkstussy/aioscrapper/issues"
|
25
|
+
|
26
|
+
[project.optional-dependencies]
|
27
|
+
dev = [
|
28
|
+
"flake8~=7.1.2",
|
29
|
+
"black~=25.1.0",
|
30
|
+
"pyright~=1.1.399",
|
31
|
+
"aiohttp[speedups]~=3.11.16",
|
32
|
+
"aiojobs~=1.4.0",
|
33
|
+
]
|
34
|
+
test = [
|
35
|
+
"pytest~=8.3.5",
|
36
|
+
"pytest-asyncio~=0.26.0",
|
37
|
+
"aresponses~=3.0.0"
|
38
|
+
]
|
39
|
+
|
40
|
+
[tool.black]
|
41
|
+
line-length = 120
|
42
|
+
include = '\.pyi?$'
|
43
|
+
exclude = '''
|
44
|
+
/(
|
45
|
+
\.eggs/|
|
46
|
+
\.git/|
|
47
|
+
\.hg/|
|
48
|
+
\.mypy_cache/|
|
49
|
+
\.tox/|
|
50
|
+
\.venv/|
|
51
|
+
\venv/|
|
52
|
+
_build/|
|
53
|
+
buck-out/|
|
54
|
+
build/|
|
55
|
+
dist/
|
56
|
+
)'''
|
57
|
+
|
58
|
+
[tool.pytest.ini_options]
|
59
|
+
asyncio_mode = "auto"
|
60
|
+
testpaths = [
|
61
|
+
"tests",
|
62
|
+
]
|
63
|
+
asyncio_default_fixture_loop_scope = "function"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import pytest
|
2
|
+
from aresponses import ResponsesMockServer
|
3
|
+
|
4
|
+
from aioscrapper import AIOScrapper
|
5
|
+
from aioscrapper.exceptions import ClientException, HTTPException
|
6
|
+
from aioscrapper.scrapper.base import BaseScrapper
|
7
|
+
from aioscrapper.types import RequestSender
|
8
|
+
|
9
|
+
|
10
|
+
class Scrapper(BaseScrapper):
|
11
|
+
def __init__(self):
|
12
|
+
self.status = None
|
13
|
+
self.response_data = None
|
14
|
+
|
15
|
+
async def start(self, request_sender: RequestSender) -> None:
|
16
|
+
await request_sender(url="https://api.test.com/v1", errback=self.errback)
|
17
|
+
|
18
|
+
async def errback(self, exc: ClientException) -> None:
|
19
|
+
if isinstance(exc, HTTPException):
|
20
|
+
self.status = exc.status_code
|
21
|
+
self.response_data = exc.message
|
22
|
+
|
23
|
+
|
24
|
+
@pytest.mark.asyncio
|
25
|
+
async def test_error(aresponses: ResponsesMockServer):
|
26
|
+
def handle_request(request):
|
27
|
+
return aresponses.Response(status=500, text="Internal Server Error")
|
28
|
+
|
29
|
+
aresponses.add("api.test.com", "/v1", "GET", response=handle_request) # pyright: ignore
|
30
|
+
|
31
|
+
scrapper = Scrapper()
|
32
|
+
async with AIOScrapper(scrappers=[scrapper]) as executor:
|
33
|
+
await executor.start()
|
34
|
+
|
35
|
+
assert scrapper.status == 500
|
36
|
+
assert scrapper.response_data == "Internal Server Error"
|
37
|
+
aresponses.assert_plan_strictly_followed()
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import pytest
|
2
|
+
from aresponses import ResponsesMockServer
|
3
|
+
|
4
|
+
from aioscrapper import AIOScrapper
|
5
|
+
from aioscrapper.scrapper.base import BaseScrapper
|
6
|
+
from aioscrapper.types import Response, RequestSender
|
7
|
+
|
8
|
+
|
9
|
+
class Scrapper(BaseScrapper):
|
10
|
+
def __init__(self):
|
11
|
+
self.response_data = None
|
12
|
+
|
13
|
+
async def start(self, request_sender: RequestSender) -> None:
|
14
|
+
await request_sender(url="https://api.test.com/v1", callback=self.parse)
|
15
|
+
|
16
|
+
async def parse(self, response: Response) -> None:
|
17
|
+
self.response_data = response.json()
|
18
|
+
|
19
|
+
|
20
|
+
@pytest.mark.asyncio
|
21
|
+
async def test_success(aresponses: ResponsesMockServer):
|
22
|
+
aresponses.add("api.test.com", "/v1", "GET", response={"status": "OK"}) # pyright: ignore
|
23
|
+
|
24
|
+
scrapper = Scrapper()
|
25
|
+
async with AIOScrapper(scrappers=[scrapper]) as executor:
|
26
|
+
await executor.start()
|
27
|
+
|
28
|
+
assert scrapper.response_data == {"status": "OK"}
|
29
|
+
aresponses.assert_plan_strictly_followed()
|
aioscrapper-0.1.1/pyproject.toml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
[project]
|
2
|
-
name = "aioscrapper"
|
3
|
-
version = "0.1.1"
|
4
|
-
authors = [{ name = "darkstussy" }, ]
|
5
|
-
description = "Async framework for building modular and scalable web scrapers."
|
6
|
-
readme = "README.md"
|
7
|
-
requires-python = ">=3.12"
|
8
|
-
dependencies = [
|
9
|
-
"aiohttp[speedups] ~= 3.11.16",
|
10
|
-
"aiojobs ~= 1.4.0",
|
11
|
-
]
|
12
|
-
classifiers = [
|
13
|
-
"Programming Language :: Python :: 3",
|
14
|
-
"Programming Language :: Python :: 3.12",
|
15
|
-
"Framework :: AsyncIO",
|
16
|
-
"Intended Audience :: Developers",
|
17
|
-
"Operating System :: OS Independent",
|
18
|
-
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
19
|
-
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
20
|
-
]
|
21
|
-
|
22
|
-
[project.urls]
|
23
|
-
Homepage = "https://github.com/darkstussy/aioscrapper"
|
24
|
-
Issues = "https://github.com/darkstussy/aioscrapper/issues"
|
@@ -1,25 +0,0 @@
|
|
1
|
-
LICENSE
|
2
|
-
README.md
|
3
|
-
pyproject.toml
|
4
|
-
src/aioscrapper/__init__.py
|
5
|
-
src/aioscrapper/config.py
|
6
|
-
src/aioscrapper/exceptions.py
|
7
|
-
src/aioscrapper/helpers.py
|
8
|
-
src/aioscrapper.egg-info/PKG-INFO
|
9
|
-
src/aioscrapper.egg-info/SOURCES.txt
|
10
|
-
src/aioscrapper.egg-info/dependency_links.txt
|
11
|
-
src/aioscrapper.egg-info/requires.txt
|
12
|
-
src/aioscrapper.egg-info/top_level.txt
|
13
|
-
src/aioscrapper/pipeline/__init__.py
|
14
|
-
src/aioscrapper/pipeline/base.py
|
15
|
-
src/aioscrapper/pipeline/dispatcher.py
|
16
|
-
src/aioscrapper/scrapper/__init__.py
|
17
|
-
src/aioscrapper/scrapper/base.py
|
18
|
-
src/aioscrapper/scrapper/executor.py
|
19
|
-
src/aioscrapper/scrapper/request_manager.py
|
20
|
-
src/aioscrapper/session/__init__.py
|
21
|
-
src/aioscrapper/session/aiohttp.py
|
22
|
-
src/aioscrapper/session/base.py
|
23
|
-
src/aioscrapper/types/__init__.py
|
24
|
-
src/aioscrapper/types/middleware.py
|
25
|
-
src/aioscrapper/types/session.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|