datablue 2.0.0__tar.gz → 2.1.0__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 (91) hide show
  1. {datablue-2.0.0 → datablue-2.1.0}/.gitignore +167 -132
  2. datablue-2.1.0/PKG-INFO +12 -0
  3. datablue-2.1.0/datablue/__init__.py +7 -0
  4. datablue-2.1.0/datablue-mcp/.gitignore +3 -0
  5. datablue-2.1.0/datablue-mcp/LICENSE +21 -0
  6. datablue-2.1.0/datablue-mcp/README.md +135 -0
  7. datablue-2.1.0/datablue-mcp/datablue-mcp-1.0.0.tgz +0 -0
  8. datablue-2.1.0/datablue-mcp/datablue-mcp-1.0.1.tgz +0 -0
  9. datablue-2.1.0/datablue-mcp/datablue-mcp-1.1.0.tgz +0 -0
  10. datablue-2.1.0/datablue-mcp/eslint.config.js +19 -0
  11. datablue-2.1.0/datablue-mcp/package-lock.json +4135 -0
  12. datablue-2.1.0/datablue-mcp/package.json +73 -0
  13. datablue-2.1.0/datablue-mcp/scripts/generate-catalog.ts +51 -0
  14. datablue-2.1.0/datablue-mcp/scripts/smoke-packed.mjs +111 -0
  15. datablue-2.1.0/datablue-mcp/src/catalog.generated.ts +2195 -0
  16. datablue-2.1.0/datablue-mcp/src/catalog.ts +39 -0
  17. datablue-2.1.0/datablue-mcp/src/config.ts +36 -0
  18. datablue-2.1.0/datablue-mcp/src/gateway.ts +231 -0
  19. datablue-2.1.0/datablue-mcp/src/index.ts +54 -0
  20. datablue-2.1.0/datablue-mcp/src/prompts.ts +74 -0
  21. datablue-2.1.0/datablue-mcp/src/resources.ts +127 -0
  22. datablue-2.1.0/datablue-mcp/src/responses.ts +42 -0
  23. datablue-2.1.0/datablue-mcp/src/server.ts +26 -0
  24. datablue-2.1.0/datablue-mcp/src/tools.ts +255 -0
  25. datablue-2.1.0/datablue-mcp/test/catalog.test.ts +53 -0
  26. datablue-2.1.0/datablue-mcp/test/cli.test.ts +35 -0
  27. datablue-2.1.0/datablue-mcp/test/config.test.ts +48 -0
  28. datablue-2.1.0/datablue-mcp/test/gateway.test.ts +270 -0
  29. datablue-2.1.0/datablue-mcp/test/readme.test.ts +35 -0
  30. datablue-2.1.0/datablue-mcp/test/server.test.ts +208 -0
  31. datablue-2.1.0/datablue-mcp/tsconfig.build.json +11 -0
  32. datablue-2.1.0/datablue-mcp/tsconfig.json +17 -0
  33. datablue-2.1.0/datablue-node/.eslintrc.json +12 -0
  34. datablue-2.1.0/datablue-node/jest.config.js +21 -0
  35. datablue-2.1.0/datablue-node/package-lock.json +5212 -0
  36. datablue-2.1.0/datablue-node/package.json +41 -0
  37. datablue-2.1.0/datablue-node/scripts/build-cjs.mjs +83 -0
  38. datablue-2.1.0/datablue-node/src/client.ts +940 -0
  39. datablue-2.1.0/datablue-node/src/errors.ts +123 -0
  40. datablue-2.1.0/datablue-node/src/http.ts +164 -0
  41. datablue-2.1.0/datablue-node/src/index.ts +13 -0
  42. datablue-2.1.0/datablue-node/src/types.ts +452 -0
  43. datablue-2.1.0/datablue-node/src/utils.ts +40 -0
  44. datablue-2.1.0/datablue-node/test/contract/api.contract.test.ts +556 -0
  45. datablue-2.1.0/datablue-node/test/unit/client.test.ts +759 -0
  46. datablue-2.1.0/datablue-node/test/unit/errors.test.ts +195 -0
  47. datablue-2.1.0/datablue-node/test/unit/http.test.ts +380 -0
  48. datablue-2.1.0/datablue-node/test/unit/utils.test.ts +103 -0
  49. datablue-2.1.0/datablue-node/tsconfig.build.json +8 -0
  50. datablue-2.1.0/datablue-node/tsconfig.cjs.json +12 -0
  51. datablue-2.1.0/datablue-node/tsconfig.json +18 -0
  52. datablue-2.1.0/datablue-node/tsconfig.test.json +10 -0
  53. datablue-2.1.0/datablue-node/tsup.config.ts +12 -0
  54. datablue-2.1.0/pyproject.toml +24 -0
  55. datablue-2.1.0/tests/test_client_config.py +211 -0
  56. datablue-2.1.0/webharvest/__init__.py +78 -0
  57. datablue-2.1.0/webharvest/client.py +1993 -0
  58. datablue-2.1.0/webharvest/exceptions.py +98 -0
  59. datablue-2.1.0/webharvest/models.py +267 -0
  60. datablue-2.0.0/CLAUDE.md +0 -499
  61. datablue-2.0.0/PKG-INFO +0 -375
  62. datablue-2.0.0/README.md +0 -346
  63. datablue-2.0.0/datablue/__init__.py +0 -79
  64. datablue-2.0.0/datablue/_batch.py +0 -60
  65. datablue-2.0.0/datablue/_http.py +0 -218
  66. datablue-2.0.0/datablue/_utils.py +0 -20
  67. datablue-2.0.0/datablue/_version.py +0 -1
  68. datablue-2.0.0/datablue/async_client.py +0 -911
  69. datablue-2.0.0/datablue/client.py +0 -1063
  70. datablue-2.0.0/datablue/config.py +0 -59
  71. datablue-2.0.0/datablue/exceptions.py +0 -191
  72. datablue-2.0.0/datablue/llms.txt +0 -161
  73. datablue-2.0.0/datablue/models/__init__.py +0 -20
  74. datablue-2.0.0/datablue/models/common.py +0 -150
  75. datablue-2.0.0/datablue/models/crawl.py +0 -61
  76. datablue-2.0.0/datablue/models/map.py +0 -46
  77. datablue-2.0.0/datablue/models/scrape.py +0 -30
  78. datablue-2.0.0/datablue/models/search.py +0 -95
  79. datablue-2.0.0/datablue/py.typed +0 -0
  80. datablue-2.0.0/keywords_1000.txt +0 -1000
  81. datablue-2.0.0/pyproject.toml +0 -49
  82. datablue-2.0.0/tests/conftest.py +0 -13
  83. datablue-2.0.0/tests/test_batch.py +0 -101
  84. datablue-2.0.0/tests/test_config.py +0 -65
  85. datablue-2.0.0/tests/test_crawl.py +0 -88
  86. datablue-2.0.0/tests/test_exceptions.py +0 -71
  87. datablue-2.0.0/tests/test_http_retry.py +0 -33
  88. datablue-2.0.0/tests/test_models.py +0 -159
  89. datablue-2.0.0/tests/test_scrape.py +0 -72
  90. datablue-2.0.0/tests/test_search.py +0 -59
  91. datablue-2.0.0/tests/test_stream.py +0 -288
@@ -1,137 +1,172 @@
1
- ADMIN_CLI.txt
2
-
3
- # Python
4
- __pycache__/
5
- *.py[cod]
6
- *$py.class
7
- *.so
8
- .Python
9
- env/
10
- venv/
11
- .venv/
12
- *.egg-info/
13
- dist/
14
- build/
15
- .eggs/
16
-
17
- # Node
18
- node_modules/
19
- .next/
20
- out/
21
- .turbo/
22
-
23
- # Environment
24
- .env
25
- .env.local
26
- .env.*.local
27
-
28
- # IDE
29
- .vscode/
30
- .idea/
31
- *.swp
32
- *.swo
33
- *~
34
-
35
- # OS
36
- .DS_Store
37
- Thumbs.db
38
-
39
- # Docker
40
- docker-compose.override.yml
41
-
42
- # Database
43
- *.sqlite3
44
- *.db
45
-
46
- # Logs
47
- *.log
48
- logs/
49
-
50
- # Coverage
51
- htmlcov/
52
- .coverage
53
- coverage/
54
- .nyc_output/
55
-
56
- # Celery
57
- celerybeat-schedule
58
- celerybeat.pid
59
-
60
- # AI tools
61
- .agent/
62
- .agents/
63
- .windsurf/
64
-
65
- # TypeScript build artifacts
66
- *.tsbuildinfo
67
- .claude/skills/
68
- .playwright-mcp/
69
-
70
- # Landing page prototypes
71
- datablue-landing-v2/
72
- .gitnexus
73
-
74
- # Deploy secrets (never commit env files with credentials)
75
- deploy/*.env
76
- deploy/generate-env.sh
77
-
78
- # Screenshots & design iterations (bloat)
79
- /*.png
80
- /logo/*.png
81
-
82
- # Embedded repos
83
- new-ui/
84
-
85
- # Research & benchmarking (ephemeral work)
86
- alt_engines_research/
87
- bing_research/
88
- brave_research/
89
- ddg_research/
90
- startpage_research/
91
- pow_capture/
92
- bench_results/
93
-
94
- # Temp scripts & result files at root
95
- /test_*.py
96
- /bench_*.py
97
- /analyze_*.py
98
- /capture_*.py
99
- /scrape_*.py
100
- /find_*.py
101
- /keyword_*.py
102
- /engine_*.py
103
- /cookie_replay*.py
104
- /pow_*.py
105
- /pow_*.js
106
- /extract_script*.py
107
- /*.csv
108
- /*.json
109
- /*.xlsx
110
- /cookie_test_*.html
111
- /google_js_shell_sample.html
112
- /datablue_*.xlsx
113
- /pow_shell_raw.html
1
+ ADMIN_CLI.txt
2
+
3
+ # Python
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+ *.so
8
+ .Python
9
+ env/
10
+ venv/
11
+ .venv/
12
+ *.egg-info/
13
+ dist/
14
+ build/
15
+ .eggs/
16
+
17
+ # Node
18
+ node_modules/
19
+ .next/
20
+ out/
21
+ .turbo/
22
+
23
+ # Environment
24
+ .env
25
+ .env.local
26
+ .env.*.local
27
+
28
+ # IDE
29
+ .vscode/
30
+ .idea/
31
+ *.swp
32
+ *.swo
33
+ *~
34
+
35
+ # OS
36
+ .DS_Store
37
+ Thumbs.db
38
+
39
+ # Docker
40
+ docker-compose.override.yml
41
+
42
+ # Database
43
+ *.sqlite3
44
+ *.db
45
+
46
+ # Logs
47
+ *.log
48
+ logs/
49
+
50
+ # Coverage
51
+ htmlcov/
52
+ .coverage
53
+ coverage/
54
+ .nyc_output/
55
+
56
+ # Celery
57
+ celerybeat-schedule
58
+ celerybeat.pid
59
+
60
+ # AI tools
61
+ .agent/
62
+ .agents/
63
+ .codex/
64
+ .windsurf/
65
+
66
+ # TypeScript build artifacts
67
+ *.tsbuildinfo
68
+ .claude/skills/
69
+ .playwright-mcp/
70
+
71
+ # Landing page prototypes
72
+ datablue-landing-v2/
73
+ .gitnexus
74
+
75
+ # Deploy secrets (never commit env files with credentials)
76
+ deploy/*.env
77
+ deploy/generate-env.sh
78
+ docs/server_cred.md
79
+ docs/server-envs/
80
+
81
+ # Screenshots & design iterations (bloat)
82
+ /*.png
83
+ /logo/*.png
84
+
85
+ # Embedded repos
86
+ new-ui/
87
+
88
+ # Research & benchmarking (ephemeral work)
89
+ /experiments/
90
+ alt_engines_research/
91
+ bing_research/
92
+ brave_research/
93
+ ddg_research/
94
+ startpage_research/
95
+ pow_capture/
96
+ bench_results/
97
+
98
+ # Temp scripts & result files at root
99
+ /test_*.py
100
+ /bench_*.py
101
+ /analyze_*.py
102
+ /capture_*.py
103
+ /scrape_*.py
104
+ /find_*.py
105
+ /keyword_*.py
106
+ /engine_*.py
107
+ /cookie_replay*.py
108
+ /pow_*.py
109
+ /pow_*.js
110
+ /extract_script*.py
111
+ /*.csv
112
+ /*.json
113
+ /*.xlsx
114
+ /cookie_test_*.html
115
+ /google_js_shell_sample.html
116
+ /datablue_*.xlsx
117
+ /pow_shell_raw.html
114
118
  /client_scrape_export.json
119
+ /*.backup-*
120
+ /instamart-*-network.txt
115
121
 
116
122
  # Output & temp directories
117
- tmp/
118
- output/
119
-
120
- # MCP config (local)
121
- .mcp.json
122
-
123
+ tmp/
124
+ .tmp/
125
+ output/
126
+
127
+ # Local POC and generated experiment output
128
+ /poc/
129
+ /poc_backups/
130
+ /.local-legacy/
131
+ /legacy/
132
+ /artifacts/
133
+ /reports/
134
+ /docker-compose.rendered-google-poc*.yml
135
+ /frontend-legacy/
136
+ /serp-worker/
137
+ /rendered-google-worker/
138
+ /browser-execution-worker/app/None/
139
+ /browser-execution-worker/profiles*/
140
+ /browser-execution-worker/tools/multipage_tab_reuse_ab.py
141
+ /browser-execution-worker/tools/us_asn_filter_canary.py
142
+ /tools/*_latest.json
143
+ /tools/native_data_api_*.json
144
+ /tools/prod_serp_*.json
145
+ /scrapingdog-*.txt
146
+ /rendered-google-worker/tests/last-*.json
147
+ /rendered-google-worker/tests/one-keyword-*.json
148
+ /rendered-google-worker/tests/phase*-*.json
149
+ /rendered-google-worker/tests/prod-*.json
150
+ /rendered-google-worker/tests/prod-*.txt
151
+ /rendered-google-worker/tests/prod-*.meta.txt
152
+ /rendered-google-worker/tests/prod-*.raw.json
153
+ /rendered-google-worker/tests/repair-*.json
154
+
155
+ # MCP config (local)
156
+ .mcp.json
157
+
123
158
  # Report/research docs (not product docs)
124
159
  BOT_DETECTION_RESEARCH.md
125
- COOKIE_REPLAY_REPORT.md
126
- MICROBROWSER_INTEGRATION.md
127
- MICROBROWSER_OSINT_REPORT.md
128
- MICROBROWSER_PLAN.md
129
- MULTI_ENGINE_DESIGN.md
130
- SEARCH_ENGINE_RESEARCH.md
131
- SERP_MISSION_REPORT.md
132
- V8_MINIRACER_REPORT.md
133
- MIGRATION_RUNBOOK.md
134
- datablue-architecture.html
135
-
136
- # Test results
137
- test-results/
160
+ COOKIE_REPLAY_REPORT.md
161
+ MICROBROWSER_INTEGRATION.md
162
+ MICROBROWSER_OSINT_REPORT.md
163
+ MICROBROWSER_PLAN.md
164
+ MULTI_ENGINE_DESIGN.md
165
+ SEARCH_ENGINE_RESEARCH.md
166
+ SERP_MISSION_REPORT.md
167
+ V8_MINIRACER_REPORT.md
168
+ MIGRATION_RUNBOOK.md
169
+ datablue-architecture.html
170
+
171
+ # Test results
172
+ test-results/
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: datablue
3
+ Version: 2.1.0
4
+ Summary: Python SDK for the DataBlue web scraping platform
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: httpx>=0.27.0
8
+ Requires-Dist: pydantic>=2.0.0
9
+ Provides-Extra: dev
10
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
11
+ Requires-Dist: pytest>=8.0; extra == 'dev'
12
+ Requires-Dist: respx>=0.21; extra == 'dev'
@@ -0,0 +1,7 @@
1
+ """DataBlue Python SDK."""
2
+
3
+ from webharvest import * # noqa: F403
4
+ from webharvest import __all__ as __all__
5
+ from webharvest import __version__ as _webharvest_version
6
+
7
+ __version__ = _webharvest_version
@@ -0,0 +1,3 @@
1
+ dist/
2
+ node_modules/
3
+ *.tgz
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DataBlue
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,135 @@
1
+ # DataBlue MCP
2
+
3
+ Official Model Context Protocol server for [DataBlue](https://www.datablue.dev). It gives MCP-compatible agents a scraper-first toolset for search, scrape, batch scrape, crawl, extraction, and DataBlue's stable public Data APIs.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 18 or newer
8
+ - A DataBlue API key from the DataBlue dashboard
9
+
10
+ ## Run
11
+
12
+ ```bash
13
+ DATABLUE_API_KEY="<your-key>" npx --yes --prefer-online @datablue/mcp@latest
14
+ ```
15
+
16
+ The server uses stdio. Do not print to or reuse its stdout stream for application logs.
17
+
18
+ ## Standard MCP JSON Configuration
19
+
20
+ Claude Desktop, Cursor, Windsurf-style clients, and other clients that use an `mcpServers` JSON file can configure DataBlue like this:
21
+
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "datablue": {
26
+ "command": "npx",
27
+ "args": ["--yes", "--prefer-online", "@datablue/mcp@latest"],
28
+ "env": {
29
+ "DATABLUE_API_KEY": "<your-key>"
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ Restart the MCP client after changing its configuration. Keep the API key in the local client configuration or environment and never commit it to source control.
37
+
38
+ ## Codex
39
+
40
+ Add the server with the Codex CLI:
41
+
42
+ ```bash
43
+ codex mcp add datablue --env DATABLUE_API_KEY=<your-key> -- npx --yes --prefer-online @datablue/mcp@latest
44
+ ```
45
+
46
+ Equivalent `~/.codex/config.toml` configuration:
47
+
48
+ ```toml
49
+ [mcp_servers.datablue]
50
+ command = "npx"
51
+ args = ["--yes", "--prefer-online", "@datablue/mcp@latest"]
52
+
53
+ [mcp_servers.datablue.env]
54
+ DATABLUE_API_KEY = "<your-key>"
55
+ ```
56
+
57
+ ## Claude Code
58
+
59
+ ```bash
60
+ claude mcp add --transport stdio datablue --env DATABLUE_API_KEY=<your-key> -- npx --yes --prefer-online @datablue/mcp@latest
61
+ ```
62
+
63
+ ## Tools
64
+
65
+ Core tools:
66
+
67
+ - `datablue_search_google`
68
+ - `datablue_scrape_url`
69
+ - `datablue_batch_scrape`
70
+ - `datablue_extract`
71
+ - `datablue_map_site`
72
+ - `datablue_start_crawl`
73
+ - `datablue_get_job_status`
74
+
75
+ Catalog tools:
76
+
77
+ - `datablue_list_data_apis`
78
+ - `datablue_run_data_api`
79
+
80
+ Call `datablue_list_data_apis` before using the generic runner when you need the current API ids, parameters, examples, limits, or live credit weights.
81
+
82
+ `datablue_scrape_url` and `datablue_batch_scrape` return the full DataBlue scrape response. Screenshot capture is exposed through scrape formats, for example `formats: ["screenshot"]` or an object format such as `{ "type": "screenshot", "capture": "full_page", "full_page": true }`.
83
+
84
+ ## Resources
85
+
86
+ - `datablue://apis`
87
+ - `datablue://pricing`
88
+ - `datablue://usage`
89
+ - `datablue://docs/scrape`
90
+ - `datablue://docs/crawl`
91
+ - `datablue://docs/google-serp`
92
+ - `datablue://examples/batch-scrape`
93
+ - `datablue://examples/research-company`
94
+
95
+ ## Prompts
96
+
97
+ - `research_company`
98
+ - `competitor_serp_report`
99
+ - `extract_products_from_url`
100
+ - `find_leads_from_google`
101
+ - `scrape_site_to_markdown`
102
+ - `monitor_keyword`
103
+
104
+ ## Configuration
105
+
106
+ | Variable | Default | Allowed |
107
+ | --- | --- | --- |
108
+ | `DATABLUE_API_KEY` | none | DataBlue API key; required for API actions |
109
+ | `DATABLUE_BASE_URL` | `https://api.datablue.dev` | DataBlue API origin |
110
+ | `DATABLUE_MCP_TIMEOUT_MS` | `60000` | `1000..300000` |
111
+ | `DATABLUE_MCP_MAX_RESULTS` | `100` | `1..100` |
112
+ | `DATABLUE_MCP_MAX_CRAWL_PAGES` | `100` | `1..1000` |
113
+
114
+ The API key is read only from the environment. It is not accepted as a tool parameter and is redacted from tool errors.
115
+
116
+ When a request exceeds a configured MCP guard such as `DATABLUE_MCP_MAX_RESULTS` or `DATABLUE_MCP_MAX_CRAWL_PAGES`, the server rejects the call before contacting DataBlue. It does not silently lower requested result counts.
117
+
118
+ ## Catalog Policy
119
+
120
+ The MCP catalog contains only endpoints published in DataBlue's docs-ready endpoint list. SDK-only helpers and APIs still under rollout are intentionally unavailable. Credit weights are fetched from DataBlue's live public weight catalog and are omitted when that catalog cannot be reached; stale weights are never hardcoded.
121
+
122
+ ## Development
123
+
124
+ ```bash
125
+ npm install
126
+ npm run catalog:sync
127
+ npm run verify
128
+ npm pack --dry-run
129
+ ```
130
+
131
+ `npm run catalog:sync` regenerates the package catalog from `web/src/app/docs/docs-data.ts`. The contract test fails if the generated catalog and docs-ready endpoint list diverge.
132
+
133
+ ## License
134
+
135
+ MIT
@@ -0,0 +1,19 @@
1
+ import eslint from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+
4
+ export default tseslint.config(
5
+ eslint.configs.recommended,
6
+ ...tseslint.configs.recommended,
7
+ {
8
+ files: ["src/**/*.ts", "test/**/*.ts"],
9
+ languageOptions: {
10
+ parserOptions: {
11
+ project: "./tsconfig.json",
12
+ tsconfigRootDir: import.meta.dirname,
13
+ },
14
+ },
15
+ },
16
+ {
17
+ ignores: ["dist/**", "node_modules/**"],
18
+ }
19
+ );