Metadata-Version: 2.4
Name: websearch-lib
Version: 0.1.0b2
Summary: A local, keyless drop-in alternative for AI search engines.
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: trafilatura[all]
Requires-Dist: ddgs[all]
Requires-Dist: playwright
Requires-Dist: playwright-stealth

# websearch-lib

A performant, keyless, and local drop-in alternative to commercial AI search tools. Built specifically for AI Agent loops, and background RAG scrapers.

## Features

- **🎯 AI-Optimized JSON Schema:** Returns cleaned, structured markdown matching standard LLM search expectations.
- **🚀 Dual-Path Extraction Architecture:** Uses ultra-fast C-accelerated `trafilatura[all]` for raw speed, falling back to an evasion-hardened `playwright-stealth` engine for heavy JavaScript walls.
- **🛡️ Built-in Content Cleaning:** Automatically scrubs out cookie banners, privacy policy walls, login portals, and legal spam.
- **⚙️ Zero Configuration Setup:** No API keys, no monthly fees, and handles its own automated browser binary downloads on first run.

---

## Installation

Install the package via `pip`:

```bash

pip install websearch-lib==0.1.0b1
 ```

Install Chromium using playwright
```bash

playwright install chromium
```

## Quick Start
The library exposes a highly natural, asynchronous .query() method perfect for AI framework integrations.

```python
import asyncio
import websearch

async def main():
    # Execute a web query
    data = await websearch.query("Latest open-source LLM benchmarks 2026", max_results=3)
    
    print(f"Query: {data['query']}")
    print(f"Fetch Time: {data['response_time']}s\n")
    
    for result in data['results']:
        print(f"Title: {result['title']}")
        print(f"URL: {result['url']}")
        print(f"Content Summary:\n{result['content']}\n" + "-"*40)

if __name__ == "__main__":
    asyncio.run(main())
```

## License
MIT License

Copyright (c) 2026 solnsumei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
