Skip to main content

A simple web searching tool similar to Tavily

Project description

Look4It 🔍

A simple web searching tool similar to Tavily - search the web and extract content programmatically without using Tavily API.

Features

  • 🌐 Web search using DuckDuckGo (no API key required)
  • 📄 Automatic content extraction from web pages
  • 🎯 Structured JSON results
  • 🚀 Simple Python API
  • 💻 Command-line interface

Installation

# Install the package
uv pip install -e .

# Install with test dependencies
uv pip install -e .[test]

Project Structure

look4it/
├── src/look4it/          # Main package
│   ├── __init__.py
│   ├── __main__.py
│   ├── cli.py
│   └── search_tool.py
├── tests/                # Test suite
├── examples/             # Usage examples
├── docs/                 # Documentation
└── pyproject.toml        # Configuration

Testing

Look4It includes comprehensive unit tests with 91% code coverage.

Run All Tests

# Using pytest
pytest

# With coverage report
pytest --cov=src/look4it --cov-report=html

Test Statistics

  • Total Tests: 31
  • Coverage: 97%
  • Status: ✅ All Passing

See TESTING.md for detailed testing documentation.

Installation

Usage

Command Line

Important: Make sure the package is installed first!

# Install package
uv pip install -e .

# Run as a module
python -m look4it "Python web scraping"

# Or use the installed command
look4it "Python web scraping"

# Results are saved to search_results.json

Python API

from look4it import Look4It

# Initialize the search tool
searcher = Look4It(max_results=5)

# Perform a search (without full content)
results = searcher.search("Python tutorial", include_content=False)
print(results)

# Perform a search with full content extraction
results = searcher.search("Python tutorial", include_content=True)

# Get formatted summary
summary = searcher.search_and_summarize("Python tutorial")
print(summary)

# Extract content from a specific URL
content = searcher.get_content("https://example.com")
print(content)

Response Format

{
  "query": "Python tutorial",
  "results": [
    {
      "title": "Learn Python - Free Interactive Python Tutorial",
      "url": "https://example.com/python",
      "snippet": "Welcome to the LearnPython.org interactive Python tutorial...",
      "content": "Full extracted content from the page...",
      "word_count": 1234
    }
  ],
  "result_count": 5
}

API Reference

Look4It Class

__init__(max_results=5, timeout=10)

Initialize the search tool.

Parameters:

  • max_results (int): Maximum number of search results to return (default: 5)
  • timeout (int): Timeout for HTTP requests in seconds (default: 10)

search(query, include_content=True)

Search the web and return structured results.

Parameters:

  • query (str): The search query
  • include_content (bool): Whether to fetch full content from pages (default: True)

Returns: Dictionary with search results and metadata

search_and_summarize(query)

Search and return a formatted text summary.

Parameters:

  • query (str): The search query

Returns: Formatted string with results

get_content(url)

Extract content from a specific URL.

Parameters:

  • url (str): The URL to extract content from

Returns: Dictionary with content and metadata

How It Works

  1. Search: Uses DuckDuckGo search API to find relevant web pages
  2. Extract: Downloads each page and extracts main content using BeautifulSoup
  3. Clean: Removes navigation, scripts, styles, and excessive whitespace
  4. Structure: Returns results in a clean JSON format

Dependencies

  • requests: HTTP requests
  • beautifulsoup4: HTML parsing
  • duckduckgo-search: Search functionality
  • lxml: Fast HTML parser

Example Use Cases

  • Research assistant tools
  • Content aggregation
  • Automated fact-checking
  • Web monitoring
  • Data collection for ML/AI projects

Differences from Tavily

Look4It is a simplified alternative to Tavily:

  • ✅ No API key required
  • ✅ Open source and free
  • ✅ Full control over search and extraction
  • ⚠️ Slower than dedicated APIs
  • ⚠️ Basic content extraction (no AI-powered summarization)
  • ⚠️ Rate limited by search engine

License

MIT License - feel free to use and modify!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

look4it-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

look4it-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file look4it-0.1.0.tar.gz.

File metadata

  • Download URL: look4it-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for look4it-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0cb8b13122d5a3cba39c2bbc27957f58c942b0309ad6c3006f6d117d859f6bee
MD5 3d0d6927593d857481f504d5013704eb
BLAKE2b-256 d3c56f42ef4bb750311f94c48cb07aa5ff2f03c3fcdc2ba53a2e6c01eafe3ea7

See more details on using hashes here.

File details

Details for the file look4it-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: look4it-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for look4it-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bb784f3232f9aebe4b8047819674303185c0aa2f3ed17eb5bff460a2c405809
MD5 622c7f7bc621855382b57a54710329f2
BLAKE2b-256 b71a8c3b8e03d711e566fd9da3cd73dc15101f9b6a41b1e59c6479fa8a819ebe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page