parallel-web-tools 0.9.3__tar.gz → 0.9.4__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 (54) hide show
  1. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/PKG-INFO +4 -4
  2. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/__init__.py +1 -1
  3. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/cli/commands.py +16 -23
  4. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/skills.py +17 -4
  5. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/bigquery/cloud_function/requirements.txt +1 -1
  6. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/pyproject.toml +6 -2
  7. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/.gitignore +0 -0
  8. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/README.md +0 -0
  9. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/cli/__init__.py +0 -0
  10. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/cli/planner.py +0 -0
  11. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/cli/skills.py +0 -0
  12. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/cli/updater.py +0 -0
  13. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/__init__.py +0 -0
  14. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/auth.py +0 -0
  15. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/batch.py +0 -0
  16. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/credentials.py +0 -0
  17. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/endpoints.py +0 -0
  18. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/findall.py +0 -0
  19. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/memory.py +0 -0
  20. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/monitor.py +0 -0
  21. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/polling.py +0 -0
  22. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/research.py +0 -0
  23. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/result.py +0 -0
  24. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/runner.py +0 -0
  25. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/schema.py +0 -0
  26. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/service.py +0 -0
  27. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/service_types.py +0 -0
  28. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/sql_utils.py +0 -0
  29. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/core/user_agent.py +0 -0
  30. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/__init__.py +0 -0
  31. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/bigquery/__init__.py +0 -0
  32. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/bigquery/cloud_function/main.py +0 -0
  33. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/bigquery/deploy.py +0 -0
  34. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/bigquery/sql/create_functions.sql +0 -0
  35. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/duckdb/__init__.py +0 -0
  36. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/duckdb/batch.py +0 -0
  37. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/duckdb/findall.py +0 -0
  38. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/duckdb/udf.py +0 -0
  39. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/polars/__init__.py +0 -0
  40. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/polars/enrich.py +0 -0
  41. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/snowflake/__init__.py +0 -0
  42. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/snowflake/deploy.py +0 -0
  43. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/snowflake/sql/01_setup.sql +0 -0
  44. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/snowflake/sql/02_create_udf.sql +0 -0
  45. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/snowflake/sql/03_cleanup.sql +0 -0
  46. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/spark/__init__.py +0 -0
  47. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/spark/streaming.py +0 -0
  48. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/spark/udf.py +0 -0
  49. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/integrations/utils.py +0 -0
  50. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/processors/__init__.py +0 -0
  51. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/processors/bigquery.py +0 -0
  52. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/processors/csv.py +0 -0
  53. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/processors/duckdb.py +0 -0
  54. {parallel_web_tools-0.9.3 → parallel_web_tools-0.9.4}/parallel_web_tools/processors/json.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: parallel-web-tools
3
- Version: 0.9.3
3
+ Version: 0.9.4
4
4
  Summary: Parallel Tools: CLI and Python SDK for AI-powered web intelligence
5
5
  Project-URL: Homepage, https://github.com/parallel-web/parallel-web-tools
6
6
  Project-URL: Documentation, https://docs.parallel.ai
@@ -34,7 +34,7 @@ Requires-Dist: polars>=1.37.0; extra == 'all'
34
34
  Requires-Dist: pyarrow>=18.0.0; extra == 'all'
35
35
  Requires-Dist: pyyaml>=6.0.0; extra == 'all'
36
36
  Requires-Dist: questionary>=2.0.0; extra == 'all'
37
- Requires-Dist: snowflake-connector-python>=3.0.0; extra == 'all'
37
+ Requires-Dist: snowflake-connector-python<5,>=4.7.3; extra == 'all'
38
38
  Requires-Dist: sqlalchemy-bigquery>=1.11.0; extra == 'all'
39
39
  Requires-Dist: sqlalchemy>=2.0.0; extra == 'all'
40
40
  Provides-Extra: bigquery
@@ -61,7 +61,7 @@ Requires-Dist: pytest>=9.0.0; extra == 'dev'
61
61
  Requires-Dist: pyyaml>=6.0.0; extra == 'dev'
62
62
  Requires-Dist: questionary>=2.0.0; extra == 'dev'
63
63
  Requires-Dist: ruff>=0.15.0; extra == 'dev'
64
- Requires-Dist: snowflake-connector-python>=3.0.0; extra == 'dev'
64
+ Requires-Dist: snowflake-connector-python<5,>=4.7.3; extra == 'dev'
65
65
  Requires-Dist: sqlalchemy-bigquery>=1.11.0; extra == 'dev'
66
66
  Requires-Dist: sqlalchemy>=2.0.0; extra == 'dev'
67
67
  Requires-Dist: ty>=0.0.33; extra == 'dev'
@@ -78,7 +78,7 @@ Provides-Extra: polars
78
78
  Requires-Dist: polars>=1.37.0; extra == 'polars'
79
79
  Requires-Dist: pyarrow>=18.0.0; extra == 'polars'
80
80
  Provides-Extra: snowflake
81
- Requires-Dist: snowflake-connector-python>=3.0.0; extra == 'snowflake'
81
+ Requires-Dist: snowflake-connector-python<5,>=4.7.3; extra == 'snowflake'
82
82
  Provides-Extra: spark
83
83
  Requires-Dist: pandas>=2.3.0; extra == 'spark'
84
84
  Requires-Dist: pyspark>=3.4.0; extra == 'spark'
@@ -43,7 +43,7 @@ from parallel_web_tools.core import (
43
43
  update_monitor,
44
44
  )
45
45
 
46
- __version__ = "0.9.3"
46
+ __version__ = "0.9.4"
47
47
 
48
48
  __all__ = [
49
49
  # Auth
@@ -1088,19 +1088,13 @@ def memory_clear(memory_scope_key: str | None, confirm_clear: bool, output_json:
1088
1088
  # Search Command
1089
1089
  # =============================================================================
1090
1090
 
1091
- # Search mode translation. V1 accepts turbo/fast/basic/advanced natively; the
1092
- # Beta-only values stay accepted CLI inputs and are translated so existing
1093
- # scripts keep working. Beta's `fast` used to downgrade to basic, but V1 now has
1094
- # a native fast mode of its own, so the name passes through.
1095
- _SEARCH_MODE_MAP = {
1096
- "turbo": "turbo",
1097
- "fast": "fast",
1098
- "basic": "basic",
1099
- "advanced": "advanced",
1091
+ # V1 modes are listed first in CLI help; fast is now native and passes through.
1092
+ # Beta-only names remain deprecated aliases so existing scripts keep working.
1093
+ _SEARCH_MODES = ("turbo", "fast", "basic", "advanced")
1094
+ _DEPRECATED_SEARCH_MODE_ALIASES = {
1100
1095
  "one-shot": "basic",
1101
1096
  "agentic": "advanced",
1102
1097
  }
1103
- _DEPRECATED_SEARCH_MODES = {"one-shot", "agentic"}
1104
1098
 
1105
1099
 
1106
1100
  def _emit_deprecation(message: str) -> None:
@@ -1135,7 +1129,7 @@ def build_search_v1_kwargs(
1135
1129
  if objective:
1136
1130
  kwargs["objective"] = objective
1137
1131
  if mode:
1138
- kwargs["mode"] = _SEARCH_MODE_MAP.get(mode, mode)
1132
+ kwargs["mode"] = _DEPRECATED_SEARCH_MODE_ALIASES.get(mode, mode)
1139
1133
  if excerpt_max_chars_total is not None:
1140
1134
  kwargs["max_chars_total"] = excerpt_max_chars_total
1141
1135
  if session_id:
@@ -1165,17 +1159,19 @@ def build_search_v1_kwargs(
1165
1159
  @click.option("-q", "--query", multiple=True, help="Keyword search query (can be repeated)")
1166
1160
  @click.option(
1167
1161
  "--mode",
1168
- type=click.Choice(list(_SEARCH_MODE_MAP.keys())),
1162
+ type=click.Choice([*_SEARCH_MODES, *_DEPRECATED_SEARCH_MODE_ALIASES]),
1169
1163
  default="basic",
1170
- help="Search mode: turbo (fastest), fast (high quality within ~1s), basic, "
1171
- "or advanced (highest quality; one-shot → basic, agentic → advanced)",
1164
+ help=(
1165
+ "Search mode: turbo (fastest), fast (high quality within ~1s), basic, "
1166
+ "or advanced (highest quality). Deprecated aliases: one-shot → basic, agentic → advanced"
1167
+ ),
1172
1168
  show_default=True,
1173
1169
  )
1174
1170
  @click.option("--max-results", type=int, help="Maximum results (defaults to server-side default of 10)")
1175
1171
  @click.option("--include-domains", multiple=True, help="Only search these domains (comma-separated or repeated)")
1176
1172
  @click.option("--exclude-domains", multiple=True, help="Exclude these domains (comma-separated or repeated)")
1177
- @click.option("--after-date", help="Only results after this date (YYYY-MM-DD)")
1178
- @click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts (min 1000)")
1173
+ @click.option("--after-date", help="Only results published on or after this date (YYYY-MM-DD)")
1174
+ @click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts")
1179
1175
  @click.option(
1180
1176
  "--excerpt-max-chars-total", type=int, default=60000, help="Max total characters for excerpts", show_default=True
1181
1177
  )
@@ -1222,12 +1218,9 @@ def search(
1222
1218
  if not objective and not query:
1223
1219
  raise click.UsageError("Provide an OBJECTIVE argument or at least one --query option.")
1224
1220
 
1225
- if mode in _DEPRECATED_SEARCH_MODES:
1226
- new_mode = _SEARCH_MODE_MAP[mode]
1227
- _emit_deprecation(
1228
- f"--mode {mode} is a Beta value and will stop working after the Beta API sunset (June 2026). "
1229
- f"Use --mode {new_mode} instead."
1230
- )
1221
+ if mode in _DEPRECATED_SEARCH_MODE_ALIASES:
1222
+ new_mode = _DEPRECATED_SEARCH_MODE_ALIASES[mode]
1223
+ _emit_deprecation(f"--mode {mode} is a deprecated alias. Use --mode {new_mode} instead.")
1231
1224
 
1232
1225
  source_policy: dict[str, Any] = {}
1233
1226
  if include_domains:
@@ -1364,7 +1357,7 @@ def build_extract_v1_kwargs(
1364
1357
  @click.option("--full-content", is_flag=True, help="Include complete page content")
1365
1358
  @click.option("--full-content-max-chars", type=int, help="Max characters per result for full content")
1366
1359
  @click.option("--no-excerpts", is_flag=True, help="Strip excerpts from output (V1 always returns them server-side)")
1367
- @click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts (min 1000)")
1360
+ @click.option("--excerpt-max-chars-per-result", type=int, help="Max characters per result for excerpts")
1368
1361
  @click.option("--excerpt-max-chars-total", type=int, help="Max total characters for excerpts across all URLs")
1369
1362
  @click.option("--max-age-seconds", type=int, help="Max age in seconds before fetching live content (min 600)")
1370
1363
  @click.option("--timeout-seconds", type=float, help="Timeout in seconds for fetching live content")
@@ -6,6 +6,7 @@ import hashlib
6
6
  import json
7
7
  import os
8
8
  import shutil
9
+ import tempfile
9
10
  import time
10
11
  from collections.abc import Iterable, Iterator
11
12
  from contextlib import contextmanager
@@ -208,7 +209,7 @@ def _skills_from_index(index: dict[str, Any]) -> dict[str, dict[str, str]]:
208
209
 
209
210
  name = raw_skill.get("name")
210
211
  skill_url = raw_skill.get("skill_url")
211
- if not isinstance(name, str) or not name.strip():
212
+ if not isinstance(name, str) or not _is_safe_skill_name(name.strip()):
212
213
  raise SkillsDownloadError("Skills index contained a skill with an invalid name")
213
214
  if not isinstance(skill_url, str) or not skill_url.strip():
214
215
  raise SkillsDownloadError(f"Skills index entry '{name}' is missing a valid skill_url")
@@ -267,6 +268,11 @@ def _safe_skill_file_path(skill_name: str, raw_path: str) -> str:
267
268
  return str(posix_path)
268
269
 
269
270
 
271
+ def _is_safe_skill_name(name: str) -> bool:
272
+ """Whether name is a single path component, so ``install_dir / name`` cannot leave install_dir."""
273
+ return name not in ("", ".", "..") and PurePosixPath(name).name == name and PureWindowsPath(name).name == name
274
+
275
+
270
276
  def _contained_target(skill_name: str, skill_dir: Path, relative_path: str) -> Path:
271
277
  """Join relative_path onto skill_dir, refusing anything that lands outside it.
272
278
 
@@ -366,7 +372,11 @@ def _write_manifest(install_dir: Path, ref: str, installed_skills: list[str]) ->
366
372
  "managed_by": "parallel-cli",
367
373
  }
368
374
  install_dir.mkdir(parents=True, exist_ok=True)
369
- _manifest_path(install_dir).write_text(json.dumps(data, indent=2))
375
+ # Replace rather than write in place: a repository can ship the manifest as a link to a file elsewhere.
376
+ fd, temp_path = tempfile.mkstemp(dir=install_dir, prefix=f"{MANIFEST_FILE_NAME}.")
377
+ with os.fdopen(fd, "w") as handle:
378
+ json.dump(data, handle, indent=2)
379
+ os.replace(temp_path, _manifest_path(install_dir))
370
380
 
371
381
 
372
382
  def _read_manifest(install_dir: Path) -> dict:
@@ -381,11 +391,14 @@ def _read_manifest(install_dir: Path) -> dict:
381
391
 
382
392
 
383
393
  def _managed_skills(install_dir: Path) -> list[str]:
384
- """Return the skill names parallel-cli previously installed into install_dir."""
394
+ """Return the skill names parallel-cli previously installed into install_dir.
395
+
396
+ A project's manifest arrives with the repository, so its names are untrusted.
397
+ """
385
398
  managed_raw = _read_manifest(install_dir).get("installed_skills")
386
399
  if not isinstance(managed_raw, list):
387
400
  return []
388
- return [name for name in managed_raw if isinstance(name, str)]
401
+ return [name for name in managed_raw if isinstance(name, str) and _is_safe_skill_name(name)]
389
402
 
390
403
 
391
404
  def install_skills(
@@ -1,5 +1,5 @@
1
1
  # Cloud Function dependencies for BigQuery Remote Function
2
2
  functions-framework>=3.0.0
3
3
  flask>=3.0.0
4
- parallel-web-tools>=0.9.3
4
+ parallel-web-tools>=0.9.4
5
5
  google-cloud-secret-manager>=2.20.0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "parallel-web-tools"
7
- version = "0.9.3"
7
+ version = "0.9.4"
8
8
  description = "Parallel Tools: CLI and Python SDK for AI-powered web intelligence"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -69,7 +69,7 @@ duckdb = [
69
69
  ]
70
70
  # Snowflake integration
71
71
  snowflake = [
72
- "snowflake-connector-python>=3.0.0",
72
+ "snowflake-connector-python>=4.7.3,<5",
73
73
  ]
74
74
  # SQLAlchemy-based BigQuery connector (for YAML configs and ETL)
75
75
  bigquery = [
@@ -168,3 +168,7 @@ dev = [
168
168
  "tach>=0.34.1",
169
169
  "ty>=0.0.33",
170
170
  ]
171
+ # Standalone binary build env (release.yml); excludes dev tools so PyInstaller can't bundle them
172
+ build = [
173
+ "pyinstaller>=6.20.0",
174
+ ]