Carved out from the google-mcp monorepo. MCP server exposing DuckDuckGo search over SearXNG, with the shared search library.
26 lines
766 B
Python
26 lines
766 B
Python
"""Shared search utilities.
|
|
|
|
Playwright-based scrapers are imported lazily so the package (and its
|
|
rate limiter) works without the optional ``playwright`` dependency.
|
|
"""
|
|
|
|
from lib.rate_limiter import RateLimiter
|
|
|
|
__all__ = ["PlaywrightManager", "RateLimiter", "GoogleSearch", "DuckDuckGoSearch"]
|
|
|
|
|
|
def __getattr__(name):
|
|
if name == "PlaywrightManager":
|
|
from lib.playwright_manager import PlaywrightManager
|
|
|
|
return PlaywrightManager
|
|
if name == "GoogleSearch":
|
|
from lib.google_search import GoogleSearch
|
|
|
|
return GoogleSearch
|
|
if name == "DuckDuckGoSearch":
|
|
from lib.duckduckgo_search import DuckDuckGoSearch
|
|
|
|
return DuckDuckGoSearch
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|