Web search and page fetch async client (SearXNG).
Web search and page fetching through a self-hosted SearXNG instance, with small, LLM-friendly results.
pip install opendata-web
import asyncio
from opendata_web import WebClient
async def main():
async with WebClient(base_url="http://localhost:8080") as client:
results = await client.search("site:gov.it open data", max_results=5)
page = await client.fetch(results[0]["url"])
print(page)
asyncio.run(main())uv sync
uv run ruff check
uv run pytest
Pushing a tag vX.Y.Z that matches the version in pyproject.toml runs
.github/workflows/release.yml: tests, build, publication to PyPI through trusted publishing
(no token in the repository) and a GitHub release. It needs, once, a pending publisher on
pypi.org for the project opendata-web: owner agent-engineering-studio, repository
opendata-web, workflow release.yml, environment pypi.
Extracted from opendata-ai's opendata_core.web at commit 71c8346.
MIT. See LICENSE.