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

With pip:

pip install fetta

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.

Development version

The latest unreleased code from main. May contain bugs, may break without notice. Use only if you need a fix that hasn't shipped to PyPI yet.

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

For reproducible installs, pin to a tag or commit:

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

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.2

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.2
File Size Uploaded
fetta-0.1.2.tar.gz 6.9 kB Details

Built distribution (wheel)

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

Total release size: 17.1 kB

Release files / fetta-0.1.2.tar.gz

Download URL fetta-0.1.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
91d6a40e4dac0e26a9777a80a498c72b8c3ae65b7a61aad529279807de9a186c
BLAKE2b-256 checksum
How to use checksums
4f4d13e6632179970a7a44a8b81f52f2ec92d002758977a7bb1d2bc0e557f715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

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

Download URL fetta-0.1.2-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60968925a398bb181055ba94c516929509ab6aaa443712a35e9028b912f96b3a
BLAKE2b-256 checksum
How to use checksums
85cdfcd46fd8b343e00a47af2614234b5fd5518ff1e2e6ae2e1ebe149b1c9bcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

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