scavio 0.1.1__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.
@@ -0,0 +1,32 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install build tools
23
+ run: pip install build twine
24
+
25
+ - name: Build
26
+ run: python -m build
27
+
28
+ - name: Publish to PyPI
29
+ env:
30
+ TWINE_USERNAME: __token__
31
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32
+ run: twine upload dist/*
@@ -0,0 +1,33 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ pip install -e ".[dev]" 2>/dev/null || pip install -e .
27
+ pip install pytest pytest-asyncio ruff
28
+
29
+ - name: Lint
30
+ run: ruff check scavio/ tests/
31
+
32
+ - name: Test
33
+ run: pytest tests/ -v
@@ -0,0 +1,11 @@
1
+ .claude/
2
+ .mcp.json
3
+ .venv/
4
+ __pycache__/
5
+ *.pyc
6
+ *.egg-info/
7
+ dist/
8
+ build/
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .env
scavio-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Scavio
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.
scavio-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,367 @@
1
+ Metadata-Version: 2.4
2
+ Name: scavio
3
+ Version: 0.1.1
4
+ Summary: Python SDK for the Scavio Search API - real-time Google, Amazon, Walmart, YouTube, Reddit, and TikTok data
5
+ Project-URL: Homepage, https://scavio.dev
6
+ Project-URL: Documentation, https://docs.scavio.dev
7
+ Project-URL: Repository, https://github.com/scavio-ai/scavio-python
8
+ Project-URL: Issues, https://github.com/scavio-ai/scavio-python/issues
9
+ Project-URL: Changelog, https://github.com/scavio-ai/scavio-python/releases
10
+ Project-URL: Dashboard, https://dashboard.scavio.dev
11
+ Author-email: Scavio <support@scavio.dev>
12
+ License-Expression: MIT
13
+ License-File: LICENSE
14
+ Keywords: ai,ai-agent,amazon,api,data-extraction,ecommerce,google-search,knowledge-graph,langchain,llm,price-comparison,product-data,reddit,scraperapi-alternative,scraping,search,serp,serpapi-alternative,social-media,tavily-alternative,tiktok,walmart,web-scraping,web-search,youtube
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Framework :: AsyncIO
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Natural Language :: English
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
28
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
29
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
30
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
31
+ Classifier: Typing :: Typed
32
+ Requires-Python: >=3.9
33
+ Requires-Dist: httpx>=0.24
34
+ Requires-Dist: requests>=2.28
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Scavio Python SDK
38
+
39
+ [![PyPI version](https://img.shields.io/pypi/v/scavio.svg)](https://pypi.org/project/scavio/)
40
+ [![Downloads](https://img.shields.io/pypi/dm/scavio.svg)](https://pypi.org/project/scavio/)
41
+ [![Python](https://img.shields.io/pypi/pyversions/scavio.svg)](https://pypi.org/project/scavio/)
42
+ [![Tests](https://github.com/scavio-ai/scavio-python/actions/workflows/test.yml/badge.svg)](https://github.com/scavio-ai/scavio-python/actions/workflows/test.yml)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
44
+
45
+ The official Python SDK for the [Scavio](https://scavio.dev) Search API. Access real-time data from Google, Amazon, Walmart, YouTube, Reddit, and TikTok with a single API key. Built for AI agents, LLM applications, and data pipelines.
46
+
47
+ > One API key, six data sources, structured JSON with knowledge graphs. A powerful alternative to Tavily, SerpAPI, and ScraperAPI for developers who need more than just web search.
48
+
49
+ ## Why Scavio
50
+
51
+ | Feature | Scavio | Tavily | SerpAPI | ScraperAPI |
52
+ |---------|--------|--------|---------|------------|
53
+ | Google Search | Yes | Yes | Yes | Yes |
54
+ | Amazon Products | Yes | No | Yes | No |
55
+ | Walmart Products | Yes | No | No | No |
56
+ | YouTube Search | Yes | No | Yes | No |
57
+ | Reddit Search | Yes | No | No | No |
58
+ | TikTok Data (11 endpoints) | Yes | No | No | No |
59
+ | Data Sources | 6 | 1 | 1 per plan | 1 |
60
+ | Structured JSON | Yes | Yes | Yes | Raw HTML |
61
+ | Knowledge Graphs | Yes | No | Yes | No |
62
+ | Async Client | Yes | Yes | No | No |
63
+ | Single API Key | Yes | Yes | No | No |
64
+ | Rate Limiting Built-in | Yes | No | No | No |
65
+ | Type Hints (PEP 561) | Yes | Yes | No | No |
66
+
67
+ Tavily focuses on AI-optimized web search. SerpAPI offers SERP parsing across search engines with separate plans. ScraperAPI provides raw web scraping with proxy rotation. Scavio combines multi-source structured data in a single SDK with one API key.
68
+
69
+ ## Installation
70
+
71
+ ```bash
72
+ pip install scavio
73
+ ```
74
+
75
+ ## Quick Start
76
+
77
+ Get your free API key at [dashboard.scavio.dev](https://dashboard.scavio.dev).
78
+
79
+ ```python
80
+ from scavio import ScavioClient
81
+
82
+ client = ScavioClient(api_key="sk_...") # or set SCAVIO_API_KEY env var
83
+
84
+ results = client.search("best noise cancelling headphones 2026")
85
+ for r in results["results"]:
86
+ print(r["title"], r["url"])
87
+ ```
88
+
89
+ ## Examples
90
+
91
+ ### 1. AI Web Research -- Feed Search Results to an LLM
92
+
93
+ ```python
94
+ from scavio import ScavioClient
95
+
96
+ client = ScavioClient()
97
+
98
+ results = client.search("latest advances in quantum computing 2026")
99
+
100
+ context = "\n\n".join(
101
+ f"[{r['title']}]({r['url']})\n{r['content']}"
102
+ for r in results["results"]
103
+ )
104
+
105
+ prompt = f"Based on these search results, summarize the latest advances:\n\n{context}"
106
+ # Pass `prompt` to your LLM of choice (OpenAI, Anthropic, etc.)
107
+ print(prompt[:500])
108
+ ```
109
+
110
+ ### 2. Price Comparison -- Amazon vs Walmart
111
+
112
+ ```python
113
+ from scavio import ScavioClient
114
+
115
+ client = ScavioClient()
116
+
117
+ query = "sony wh-1000xm5"
118
+ amazon = client.amazon.search(query, domain="com")
119
+ walmart = client.walmart.search(query)
120
+
121
+ print("Amazon:")
122
+ for p in amazon["data"]["products"][:3]:
123
+ print(f" ${p['price']} - {p['title'][:60]}")
124
+
125
+ print("\nWalmart:")
126
+ for p in walmart["data"]["products"][:3]:
127
+ print(f" ${p['price']} - {p['title'][:60]}")
128
+ ```
129
+
130
+ ### 3. Product Lookup by ASIN
131
+
132
+ ```python
133
+ from scavio import ScavioClient
134
+
135
+ client = ScavioClient()
136
+
137
+ product = client.amazon.product("B0BS1PRC4L")
138
+ data = product["data"]
139
+
140
+ print(f"Brand: {data['brand']}")
141
+ print(f"Title: {data['title']}")
142
+ print(f"Rating: {data['rating']} ({data['reviews_count']} reviews)")
143
+ print(f"Price: ${data['buybox'][0]['price']}")
144
+ ```
145
+
146
+ ### 4. SEO Competitor Analysis
147
+
148
+ ```python
149
+ from scavio import ScavioClient
150
+
151
+ client = ScavioClient()
152
+
153
+ results = client.search("best project management software", country_code="us")
154
+
155
+ domains = {}
156
+ for r in results["results"]:
157
+ domain = r["domain"]
158
+ domains[domain] = domains.get(domain, 0) + 1
159
+
160
+ print("Domains ranking for this keyword:")
161
+ for domain, count in sorted(domains.items(), key=lambda x: -x[1]):
162
+ print(f" {domain}: {count} result(s)")
163
+ ```
164
+
165
+ ### 5. News Aggregation
166
+
167
+ ```python
168
+ from scavio import ScavioClient
169
+
170
+ client = ScavioClient()
171
+
172
+ news = client.google.search("AI startups", search_type="news")
173
+
174
+ for article in news["news_results"][:5]:
175
+ print(f"[{article['source']}] {article['title']}")
176
+ print(f" {article['link']}")
177
+ print()
178
+ ```
179
+
180
+ ### 6. YouTube Content Discovery
181
+
182
+ ```python
183
+ from scavio import ScavioClient
184
+
185
+ client = ScavioClient()
186
+
187
+ videos = client.youtube.search("python tutorial", sort_by="view_count")
188
+
189
+ for v in videos["data"]["results"][:5]:
190
+ title = v["title"]["runs"][0]["text"]
191
+ views = v.get("viewCountText", {}).get("simpleText", "N/A")
192
+ print(f"{title} ({views})")
193
+ print(f" https://youtube.com/watch?v={v['videoId']}")
194
+
195
+ # Get detailed metadata for a specific video
196
+ meta = client.youtube.metadata("dQw4w9WgXcQ")
197
+ print(f"\n{meta['data']['title']}")
198
+ print(f" {meta['data']['view_count']:,} views, {meta['data']['like_count']:,} likes")
199
+ ```
200
+
201
+ ### 7. Reddit Market Research
202
+
203
+ ```python
204
+ from scavio import ScavioClient
205
+
206
+ client = ScavioClient()
207
+
208
+ posts = client.reddit.search("best mechanical keyboard", sort="hot")
209
+
210
+ for post in posts["data"]["posts"]:
211
+ print(f"r/{post['subreddit']} - {post['title']}")
212
+ print(f" {post['url']}")
213
+ print()
214
+ ```
215
+
216
+ ### 8. TikTok Hashtag Analysis
217
+
218
+ ```python
219
+ from scavio import ScavioClient
220
+
221
+ client = ScavioClient()
222
+
223
+ hashtag = client.tiktok.hashtag(hashtag_name="python")
224
+ info = hashtag["data"]["challengeInfo"]
225
+
226
+ print(f"#{info['challenge']['title']}")
227
+ print(f" Views: {int(info['statsV2']['viewCount']):,}")
228
+ print(f" Videos: {int(info['statsV2']['videoCount']):,}")
229
+ ```
230
+
231
+ ### 9. Social Media Monitoring
232
+
233
+ ```python
234
+ from scavio import ScavioClient
235
+
236
+ client = ScavioClient()
237
+
238
+ brand = "scavio"
239
+ reddit = client.reddit.search(brand, sort="hot")
240
+ tiktok = client.tiktok.search_videos(brand, count=5)
241
+
242
+ print(f"Reddit mentions ({len(reddit['data']['posts'])}):")
243
+ for post in reddit["data"]["posts"][:3]:
244
+ print(f" r/{post['subreddit']}: {post['title']}")
245
+
246
+ tiktok_videos = tiktok["data"].get("search_item_list", [])
247
+ print(f"\nTikTok mentions ({len(tiktok_videos)}):")
248
+ for v in tiktok_videos[:3]:
249
+ desc = v["aweme_info"].get("desc", "No description")
250
+ print(f" {desc[:80]}")
251
+ ```
252
+
253
+ ### 10. Price Drop Alert
254
+
255
+ ```python
256
+ from scavio import ScavioClient
257
+
258
+ client = ScavioClient()
259
+
260
+ product = client.walmart.product("123456789")
261
+ price = product["data"]["price"]
262
+ title = product["data"]["title"]
263
+
264
+ threshold = 50.00
265
+ if price and price < threshold:
266
+ print(f"PRICE DROP: {title[:60]}")
267
+ print(f" Now ${price} (threshold: ${threshold})")
268
+ else:
269
+ print(f"{title[:60]}: ${price}")
270
+ ```
271
+
272
+ ### 11. Async Multi-Source Search
273
+
274
+ ```python
275
+ import asyncio
276
+ from scavio import AsyncScavioClient
277
+
278
+ async def main():
279
+ async with AsyncScavioClient() as client:
280
+ google = await client.search("mechanical keyboard")
281
+ amazon = await client.amazon.search("mechanical keyboard", domain="com")
282
+
283
+ print(f"Google: {len(google['results'])} results")
284
+ print(f"Amazon: {len(amazon['data']['products'])} products")
285
+
286
+ for r in google["results"][:3]:
287
+ print(f" Web: {r['title'][:60]}")
288
+ for p in amazon["data"]["products"][:3]:
289
+ print(f" Amazon: ${p['price']} - {p['title'][:50]}")
290
+
291
+ asyncio.run(main())
292
+ ```
293
+
294
+ ### 12. Check API Usage
295
+
296
+ ```python
297
+ from scavio import ScavioClient
298
+
299
+ client = ScavioClient()
300
+
301
+ usage = client.get_usage()
302
+ print(f"Plan: {usage['plan']}")
303
+ print(f"Credits remaining: {usage['credit_balance']}")
304
+ ```
305
+
306
+ ## Error Handling
307
+
308
+ ```python
309
+ from scavio import (
310
+ ScavioClient,
311
+ InvalidAPIKeyError,
312
+ RateLimitError,
313
+ InsufficientCreditsError,
314
+ )
315
+
316
+ client = ScavioClient(api_key="sk_...")
317
+
318
+ try:
319
+ results = client.search("query")
320
+ except InvalidAPIKeyError:
321
+ print("Check your API key")
322
+ except RateLimitError:
323
+ print("Too many requests - upgrade your plan")
324
+ except InsufficientCreditsError:
325
+ print("Out of credits - purchase more at dashboard.scavio.dev")
326
+ ```
327
+
328
+ ## Configuration
329
+
330
+ ```python
331
+ client = ScavioClient(
332
+ api_key="sk_...",
333
+ base_url="https://api.scavio.dev", # custom base URL
334
+ timeout=30, # request timeout in seconds
335
+ max_requests_per_second=1, # rate limiting (1-10)
336
+ )
337
+ ```
338
+
339
+ ## Integrations
340
+
341
+ Scavio works with popular AI/LLM frameworks:
342
+
343
+ - [LangChain](https://github.com/scavio-ai/langchain-scavio) -- `pip install langchain-scavio`
344
+ - [MCP Server](https://www.npmjs.com/package/@scavio/mcp-server) -- for Claude, Cursor, and other MCP clients
345
+ - [n8n](https://www.npmjs.com/package/n8n-nodes-scavio) -- no-code workflow automation
346
+
347
+ ## API Reference
348
+
349
+ | Service | Endpoints | Credits |
350
+ |---------|-----------|---------|
351
+ | Google | `search` | 1-2 |
352
+ | Amazon | `search`, `product` | 1 each |
353
+ | Walmart | `search`, `product` | 1 each |
354
+ | YouTube | `search`, `metadata` | 1 each |
355
+ | Reddit | `search`, `post` | 2 each |
356
+ | TikTok | `profile`, `user_posts`, `video`, `video_comments`, `comment_replies`, `search_videos`, `search_users`, `hashtag`, `hashtag_videos`, `user_followers`, `user_followings` | 1 each |
357
+
358
+ ## Links
359
+
360
+ - [Website](https://scavio.dev)
361
+ - [Documentation](https://docs.scavio.dev)
362
+ - [Dashboard & API Keys](https://dashboard.scavio.dev)
363
+ - [API Reference](https://docs.scavio.dev/api-reference)
364
+
365
+ ## License
366
+
367
+ MIT