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.2.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.2.0
File Size Uploaded Provenance Actions
fetta-0.2.0.tar.gz 12.4 kB With provenance Details for fetta-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 29.6 kB

Release files / fetta-0.2.0.tar.gz

Download URL fetta-0.2.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b7bac58fd8ad99f02f55e5fb252fe75b0553bb19ce8ace3938c13b50351fbaf9
BLAKE2b-256 checksum
How to use checksums
2e6e7969631a4c33a9dd2f6ee0a36ca07a22be7c74a3bca89b370f10a7429c9a
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 Oct 18, 2026.

Transparency log

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

Download URL fetta-0.2.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
998e4d0b247ca4dff1eeef0a38b67a8a36e653bac2a64ebc71b9c18dd6c69b03
BLAKE2b-256 checksum
How to use checksums
8d7bccd95c6f437bd8913477a1136289a18e6d5cd7845318d9b451987e49fb34
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 Oct 18, 2026.

Transparency log

Security for fetta 0.2.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.2.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 Oct 18, 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