wxpath 0.5.0__tar.gz → 0.5.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.
Files changed (50) hide show
  1. {wxpath-0.5.0/src/wxpath.egg-info → wxpath-0.5.2}/PKG-INFO +9 -6
  2. {wxpath-0.5.0 → wxpath-0.5.2}/README.md +6 -4
  3. {wxpath-0.5.0 → wxpath-0.5.2}/pyproject.toml +3 -3
  4. wxpath-0.5.2/src/wxpath/core/exceptions.py +53 -0
  5. {wxpath-0.5.0 → wxpath-0.5.2/src/wxpath.egg-info}/PKG-INFO +9 -6
  6. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath.egg-info/SOURCES.txt +1 -0
  7. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath.egg-info/requires.txt +2 -1
  8. {wxpath-0.5.0 → wxpath-0.5.2}/LICENSE +0 -0
  9. {wxpath-0.5.0 → wxpath-0.5.2}/setup.cfg +0 -0
  10. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/__init__.py +0 -0
  11. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/cli.py +0 -0
  12. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/__init__.py +0 -0
  13. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/dom.py +0 -0
  14. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/models.py +0 -0
  15. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/ops.py +0 -0
  16. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/parser.py +0 -0
  17. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/runtime/__init__.py +0 -0
  18. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/runtime/engine.py +0 -0
  19. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/core/runtime/helpers.py +0 -0
  20. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/hooks/__init__.py +0 -0
  21. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/hooks/builtin.py +0 -0
  22. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/hooks/registry.py +0 -0
  23. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/__init__.py +0 -0
  24. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/client/__init__.py +0 -0
  25. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/client/cache.py +0 -0
  26. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/client/crawler.py +0 -0
  27. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/client/request.py +0 -0
  28. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/client/response.py +0 -0
  29. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/policy/backoff.py +0 -0
  30. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/policy/retry.py +0 -0
  31. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/policy/robots.py +0 -0
  32. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/policy/throttler.py +0 -0
  33. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/http/stats.py +0 -0
  34. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/integrations/__init__.py +0 -0
  35. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/integrations/langchain/__init__.py +0 -0
  36. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/integrations/langchain/examples/basic_rag.py +0 -0
  37. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/integrations/langchain/examples/rolling_window_rag.py +0 -0
  38. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/integrations/langchain/loader.py +0 -0
  39. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/patches.py +0 -0
  40. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/settings.py +0 -0
  41. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/tui.py +0 -0
  42. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/tui_settings.py +0 -0
  43. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/util/__init__.py +0 -0
  44. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/util/cleaners.py +0 -0
  45. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/util/common_paths.py +0 -0
  46. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/util/logging.py +0 -0
  47. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath/util/serialize.py +0 -0
  48. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath.egg-info/dependency_links.txt +0 -0
  49. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath.egg-info/entry_points.txt +0 -0
  50. {wxpath-0.5.0 → wxpath-0.5.2}/src/wxpath.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wxpath
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: wxpath - a declarative web crawler and data extractor
5
5
  Author-email: Rodrigo Palacios <rodrigopala91@gmail.com>
6
6
  License-Expression: MIT
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: lxml>=4.0
16
16
  Requires-Dist: elementpath<=5.0.3,>=5.0.0
17
- Requires-Dist: aiohttp<=3.12.15,>=3.8.0
17
+ Requires-Dist: aiohttp<=4.0.0,>=3.8.0
18
18
  Requires-Dist: tqdm>=4.0.0
19
19
  Provides-Extra: cache
20
20
  Requires-Dist: aiohttp-client-cache>=0.14.0; extra == "cache"
@@ -35,6 +35,7 @@ Requires-Dist: pytest>=7.0; extra == "test"
35
35
  Requires-Dist: pytest-asyncio>=0.23; extra == "test"
36
36
  Provides-Extra: dev
37
37
  Requires-Dist: ruff; extra == "dev"
38
+ Requires-Dist: tox; extra == "dev"
38
39
  Provides-Extra: docs
39
40
  Requires-Dist: mkdocs>=1.5; extra == "docs"
40
41
  Requires-Dist: mkdocs-material>=9.0; extra == "docs"
@@ -54,7 +55,7 @@ Dynamic: license-file
54
55
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/release/python-3100/) [![Documentation Status](https://img.shields.io/badge/documentation-green.svg)](https://rodricios.github.io/wxpath)
55
56
 
56
57
 
57
- > NEW: [TUI](https://rodricios.github.io/wxpath/tui/quickstart.md) - Interactive terminal interface (powered by Textual) for testing wxpath expressions and exporting data.
58
+ > NEW: [TUI](https://rodricios.github.io/wxpath/tui/quickstart) - Interactive terminal interface (powered by Textual) for testing wxpath expressions and exporting data.
58
59
 
59
60
  ![Wxpath TUI Demo screenshot](docs/assets/images/demo1.jpg)
60
61
 
@@ -64,8 +65,10 @@ Requires Python 3.10+.
64
65
 
65
66
  ```
66
67
  pip install wxpath
67
- # For TUI support
68
- pip install wxpath[tui]
68
+ # For TUI support:
69
+ pip install "wxpath[tui]"
70
+ # Immediately launch the TUI via uv:
71
+ uvx --from "wxpath[tui]" wxpath-tui
69
72
  ```
70
73
  ---
71
74
 
@@ -356,7 +359,7 @@ Command line options:
356
359
 
357
360
  **wxpath** provides a terminal interface (TUI) for interactive expression testing and data extraction.
358
361
 
359
- See [TUI Quickstart](https://rodricios.github.io/wxpath/tui/quickstart.md) for more details.
362
+ See [TUI Quickstart](https://rodricios.github.io/wxpath/tui/quickstart) for more details.
360
363
 
361
364
  ## Persistence and Caching
362
365
 
@@ -3,7 +3,7 @@
3
3
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/release/python-3100/) [![Documentation Status](https://img.shields.io/badge/documentation-green.svg)](https://rodricios.github.io/wxpath)
4
4
 
5
5
 
6
- > NEW: [TUI](https://rodricios.github.io/wxpath/tui/quickstart.md) - Interactive terminal interface (powered by Textual) for testing wxpath expressions and exporting data.
6
+ > NEW: [TUI](https://rodricios.github.io/wxpath/tui/quickstart) - Interactive terminal interface (powered by Textual) for testing wxpath expressions and exporting data.
7
7
 
8
8
  ![Wxpath TUI Demo screenshot](docs/assets/images/demo1.jpg)
9
9
 
@@ -13,8 +13,10 @@ Requires Python 3.10+.
13
13
 
14
14
  ```
15
15
  pip install wxpath
16
- # For TUI support
17
- pip install wxpath[tui]
16
+ # For TUI support:
17
+ pip install "wxpath[tui]"
18
+ # Immediately launch the TUI via uv:
19
+ uvx --from "wxpath[tui]" wxpath-tui
18
20
  ```
19
21
  ---
20
22
 
@@ -305,7 +307,7 @@ Command line options:
305
307
 
306
308
  **wxpath** provides a terminal interface (TUI) for interactive expression testing and data extraction.
307
309
 
308
- See [TUI Quickstart](https://rodricios.github.io/wxpath/tui/quickstart.md) for more details.
310
+ See [TUI Quickstart](https://rodricios.github.io/wxpath/tui/quickstart) for more details.
309
311
 
310
312
  ## Persistence and Caching
311
313
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wxpath"
7
- version = "0.5.0"
7
+ version = "0.5.2"
8
8
  description = "wxpath - a declarative web crawler and data extractor"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -17,7 +17,7 @@ license-files = ["LICENSE"]
17
17
  dependencies = [
18
18
  "lxml>=4.0",
19
19
  "elementpath>=5.0.0,<=5.0.3",
20
- "aiohttp>=3.8.0,<=3.12.15",
20
+ "aiohttp>=3.8.0,<=4.0.0",
21
21
  "tqdm>=4.0.0"
22
22
  ]
23
23
 
@@ -40,7 +40,7 @@ llm = ["langchain>=1.0.0", "langchain-core>=1.0.0", "langchain-ollama>=1.0.0",
40
40
  "langchain-text-splitters>=1.1.0"]
41
41
 
42
42
  test = ["pytest>=7.0", "pytest-asyncio>=0.23"]
43
- dev = ["ruff"]
43
+ dev = ["ruff", "tox"]
44
44
  docs = ["mkdocs>=1.5", "mkdocs-material>=9.0", "mkdocstrings[python]>=0.24", "mkdocs-macros-plugin>=1.0", "mkdocs-resize-images>=1.0", "mkdocs-glightbox", "pyyaml>=6.0"]
45
45
  tui = ["textual>=1.0.0", "aiohttp-client-cache>=0.14.0", "aiohttp-client-cache[sqlite]"]
46
46
 
@@ -0,0 +1,53 @@
1
+ class XPathEvaluationError(Exception):
2
+ """Errors during XPath evaluation with elementpath."""
3
+
4
+ def __init__(
5
+ self,
6
+ message: str,
7
+ xpath: str,
8
+ base_url: str | None = None,
9
+ element_tag: str | None = None,
10
+ error_code: str | None = None, # XPath error codes like XPST0003
11
+ position: tuple[int, int] | None = None, # (line, column)
12
+ original_error: Exception | None = None
13
+ ):
14
+ context = {
15
+ "xpath": xpath,
16
+ "base_url": base_url,
17
+ "element_tag": element_tag,
18
+ "error_code": error_code,
19
+ "position": position,
20
+ }
21
+ if original_error:
22
+ context["original_error"] = str(original_error)
23
+ # Extract XPath error code if present (e.g., [err:XPST0003])
24
+ if hasattr(original_error, 'code'):
25
+ context["error_code"] = original_error.code
26
+
27
+ super().__init__(message, context)
28
+
29
+ def to_dict(self) -> dict:
30
+ return {
31
+ "message": self.message,
32
+ "xpath": self.xpath,
33
+ "base_url": self.base_url,
34
+ "element_tag": self.element_tag,
35
+ "error_code": self.error_code,
36
+ "position": self.position,
37
+ "original_error": self.original_error,
38
+ }
39
+
40
+
41
+ class XPathSyntaxError(XPathEvaluationError):
42
+ """Invalid XPath syntax."""
43
+ pass
44
+
45
+
46
+ class XPathTypeError(XPathEvaluationError):
47
+ """Type error in XPath expression."""
48
+ pass
49
+
50
+
51
+ class XPathRuntimeError(XPathEvaluationError):
52
+ """Runtime error during XPath evaluation."""
53
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wxpath
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: wxpath - a declarative web crawler and data extractor
5
5
  Author-email: Rodrigo Palacios <rodrigopala91@gmail.com>
6
6
  License-Expression: MIT
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: lxml>=4.0
16
16
  Requires-Dist: elementpath<=5.0.3,>=5.0.0
17
- Requires-Dist: aiohttp<=3.12.15,>=3.8.0
17
+ Requires-Dist: aiohttp<=4.0.0,>=3.8.0
18
18
  Requires-Dist: tqdm>=4.0.0
19
19
  Provides-Extra: cache
20
20
  Requires-Dist: aiohttp-client-cache>=0.14.0; extra == "cache"
@@ -35,6 +35,7 @@ Requires-Dist: pytest>=7.0; extra == "test"
35
35
  Requires-Dist: pytest-asyncio>=0.23; extra == "test"
36
36
  Provides-Extra: dev
37
37
  Requires-Dist: ruff; extra == "dev"
38
+ Requires-Dist: tox; extra == "dev"
38
39
  Provides-Extra: docs
39
40
  Requires-Dist: mkdocs>=1.5; extra == "docs"
40
41
  Requires-Dist: mkdocs-material>=9.0; extra == "docs"
@@ -54,7 +55,7 @@ Dynamic: license-file
54
55
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/release/python-3100/) [![Documentation Status](https://img.shields.io/badge/documentation-green.svg)](https://rodricios.github.io/wxpath)
55
56
 
56
57
 
57
- > NEW: [TUI](https://rodricios.github.io/wxpath/tui/quickstart.md) - Interactive terminal interface (powered by Textual) for testing wxpath expressions and exporting data.
58
+ > NEW: [TUI](https://rodricios.github.io/wxpath/tui/quickstart) - Interactive terminal interface (powered by Textual) for testing wxpath expressions and exporting data.
58
59
 
59
60
  ![Wxpath TUI Demo screenshot](docs/assets/images/demo1.jpg)
60
61
 
@@ -64,8 +65,10 @@ Requires Python 3.10+.
64
65
 
65
66
  ```
66
67
  pip install wxpath
67
- # For TUI support
68
- pip install wxpath[tui]
68
+ # For TUI support:
69
+ pip install "wxpath[tui]"
70
+ # Immediately launch the TUI via uv:
71
+ uvx --from "wxpath[tui]" wxpath-tui
69
72
  ```
70
73
  ---
71
74
 
@@ -356,7 +359,7 @@ Command line options:
356
359
 
357
360
  **wxpath** provides a terminal interface (TUI) for interactive expression testing and data extraction.
358
361
 
359
- See [TUI Quickstart](https://rodricios.github.io/wxpath/tui/quickstart.md) for more details.
362
+ See [TUI Quickstart](https://rodricios.github.io/wxpath/tui/quickstart) for more details.
360
363
 
361
364
  ## Persistence and Caching
362
365
 
@@ -15,6 +15,7 @@ src/wxpath.egg-info/requires.txt
15
15
  src/wxpath.egg-info/top_level.txt
16
16
  src/wxpath/core/__init__.py
17
17
  src/wxpath/core/dom.py
18
+ src/wxpath/core/exceptions.py
18
19
  src/wxpath/core/models.py
19
20
  src/wxpath/core/ops.py
20
21
  src/wxpath/core/parser.py
@@ -1,6 +1,6 @@
1
1
  lxml>=4.0
2
2
  elementpath<=5.0.3,>=5.0.0
3
- aiohttp<=3.12.15,>=3.8.0
3
+ aiohttp<=4.0.0,>=3.8.0
4
4
  tqdm>=4.0.0
5
5
 
6
6
  [cache]
@@ -14,6 +14,7 @@ aiohttp-client-cache[sqlite]
14
14
 
15
15
  [dev]
16
16
  ruff
17
+ tox
17
18
 
18
19
  [docs]
19
20
  mkdocs>=1.5
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