Skip to main content

fetta

Tool that fetches web pages for assistants. Give it a URL, get back clean text. Handles static pages and SPAs

⚡ Async-first

fetta is async-only. Every fetcher is an async def, every method is awaited. There is no sync API.

This is deliberate. fetta is built for the runtimes where agents actually run MCP servers, LangChain/LangGraph pipelines, FastAPI backends. All of these are async. A sync fetcher would block the event loop and stall every other request in the process.

If you're in a sync context, bridge it at your entry point:

import asyncio
from fetta import HttpFetcher

async def fetch_content(url: str) -> str:
    async with HttpFetcher() as fetcher:
        page = await fetcher.fetch(url)
        return page.text

# Sync entry point is top of a script, not inside an async function
text = asyncio.run(fetch_content("https://example.com"))

Don't call asyncio.run() from inside an async function that raises RuntimeError. The bridge is for the outermost layer of sync programs only.

Install

fetta is not on PyPI yet. Install directly from GitHub.

As a library

With uv (recommended):

uv add "fetta @ git+https://github.com/spapulin/fetta.git"

With pip:

pip install "fetta @ git+https://github.com/spapulin/fetta.git"

For browser-based fetching, also install Chromium:

# With uv
uv run playwright install chromium --with-deps

# With pip (venv activated)
python -m playwright install chromium --with-deps

--with-deps installs system libraries and requires sudo on Linux. On macOS, drop the flag.

Skip this step entirely if you only use HttpFetcher.

Set up for development

With Docker

git clone https://github.com/spapulin/fetta.git
cd fetta

make up      # build image, start container
make sync    # install dependencies in the container
make test    # run tests in the container

Playwright browsers and system libraries are baked into the image.

Optional: IDE autocompletion

PyCharm and other IDEs need a local Python interpreter for autocompletion and "go to definition". Create a lightweight host venv - runtime packages only, no dev tools, no browsers:

# With uv
uv venv
uv pip install -e .

# With pip
python -m venv .venv
source .venv/bin/activate
pip install -e .

Point your IDE at .venv/bin/python.

Code still runs inside Docker (make test). The host venv is only for the editor - it has no Playwright browsers and cannot execute BrowserFetcher.

Without Docker

git clone https://github.com/spapulin/fetta.git
cd fetta

uv sync --dev
uv run playwright install chromium --with-deps
uv run pytest

Quickstart

The fastest way to try fetta is the Jupyter notebook:

notebooks/quickstart.ipynb

It walks through:

  • Fetching a static page with HttpFetcher
  • Rendering a JavaScript-heavy page with BrowserFetcher
  • Using SmartFetcher to pick the right engine automatically
  • Extracting text and inspecting the result

Running the notebook

With Docker (recommended):

make jupyter

Then open http://localhost:8888 and navigate to notebooks/quickstart.ipynb.

Without Docker:

uv run jupyter lab

Requirements

  • Python 3.12+
  • Playwright browsers (Chromium) - only for BrowserFetcher and SmartFetcher
  • Docker - only for development

License

MIT — see LICENSE

Release files for fetta 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fetta 0.1.0
File Size Uploaded
fetta-0.1.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fetta 0.1.0
File Interpreter ABI Platform
fetta-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / fetta-0.1.0.tar.gz

Download URL fetta-0.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d44b06b49d1c03c6a143200e4fe238f98ec9b1c5da4195e466f4f84f9df8d0b5
BLAKE2b-256 checksum
How to use checksums
d21c538219294692b7d21f84c9e18fd75e5025b4be8fff701b0b2eb2d535d6e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / fetta-0.1.0-py3-none-any.whl

Download URL fetta-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e8cd8d466684ee09f77658158ef45405324e03841932469bda92819ec0bc599
BLAKE2b-256 checksum
How to use checksums
7424b8cd8df90a4454c098f5653ea818909a26deed1c913cc9118ee7410439bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page