Standalone Python library for web content fetching, HTML-to-Markdown conversion, visual element manifests, text quoting, element quoting, and media download helpers.
html2html(...)cleans raw HTML into readable HTML.html2md(...)converts HTML into Markdown plus a visual element manifest.fetch_html(...)fetches page HTML with optional page-artifact caching.quote_text(...)finds text on a page and returns annotated screenshots.quote_element(...)finds visual elements such asP_0,T_1, orM_0.MediaDownloaderdownloads media URLs from post-like payloads.MediaConfigandWebToolsConfigdescribe caller-facing configuration.MediaTypeandVisualElementTypeprovide stable public vocabulary.
uv sync --group dev
uv run py-lib-smoke-public-api
uv run pytest tests/web_tools -m "not slow" -qfrom web_tools import html2md
response = html2md("<article><h1>Hello</h1><p>World</p></article>")
print(response.markdown)
print(response.manifest.counts)src/web_tools/contains the shipped package.src/web_tools/_api/contains public declarations and thin facades.src/web_tools/_internal/contains private implementation.tests/web_tools/contains package-specific verification.workbench/web_tools/contains manual probes that do not import the shipped package.docs/web_tools/contains package architecture, usage, and verification notes.- Shared test and repo tooling comes from
py-lib-tooling. - Shared runtime support comes from
py-lib-runtime.