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.content.html

# 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

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

Metadata

Release files for fetta 0.3.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.3.0
File Size Uploaded Provenance Actions
fetta-0.3.0.tar.gz 14.1 kB With provenance Details for fetta-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 33.5 kB

Release files / fetta-0.3.0.tar.gz

Download URL fetta-0.3.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cadd37cb859b1c660bbead4ffda31cfee11ae4094759625dd06f18bcd46ee721
BLAKE2b-256 checksum
How to use checksums
3d9389a572706d6ab7e403e4f6cca8191ac6108e43bb331b1577517c0b02e610
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 Nov 8, 2026.

Transparency log

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

Download URL fetta-0.3.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b723d60f6f9c6fd7ac9725227cbb9f65d968f40d7e7af7dfe6aa2218990d4ec2
BLAKE2b-256 checksum
How to use checksums
828222d135f412409c98170d1546b27363fb4cccc8c6a971f7e2a55049ea408b
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 Nov 8, 2026.

Transparency log

Security for fetta 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fetta-0.3.0.tar.gz

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 Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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