Skip to main content

Python wrapper for the Rawfy AI agent skill — converts any URL into structured, agent-readable content

Project description

Rawfy Python Wrapper

Python bindings for the Rawfy AI agent skill.

Prerequisites

  • Node.js >= 18 — Rawfy is a Node.js tool
  • Rawfy CLInpm install -g rawfy

Install

pip install .

Quick Start

from rawfy import fetch, metadata

# Full page fetch (returns WSM markdown)
content = fetch("https://example.com")

# Get structured JSON data
import json
data = fetch("https://example.com", format="json")
parsed = json.loads(data)

# Or use the convenience wrapper
from rawfy import fetch_json
data = fetch_json("https://example.com")
print(data["metadata"]["title"])

# Lightweight metadata only
meta = metadata("https://docs.python.org")
print(f"Title: {meta['title']}, Words: {meta['word_count']}")

API

fetch(url, *, format="markdown", vision=False, no_playwright=False, max_tokens=50000, timeout=30)

Fetch and process a URL. Returns the content as a string.

fetch_json(url, **kwargs)

Same as fetch() with format="json", returns a parsed dict.

metadata(url, *, no_playwright=False, timeout=15)

Fetch only page metadata (lightweight). Returns a dict.

check_installation()

Check if Rawfy and dependencies are installed. Returns a status dict.

Error Handling

from rawfy import fetch, RawfyError

try:
    content = fetch("https://example.com")
except RawfyError as e:
    print(f"Error [{e.code}]: {e}")
    print(f"URL: {e.url}")

CLI

python -m rawfy https://example.com
python -m rawfy https://example.com --format json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rawfy-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rawfy-0.1.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file rawfy-0.1.3.tar.gz.

File metadata

  • Download URL: rawfy-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for rawfy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 41c47158755db72e6cc98c3145d91e2b04e2f2957e98fdf5409404c9b9b21417
MD5 63c78b74d57df4f84e1b3125ce0ddf27
BLAKE2b-256 707c3ca5fe97e3263d3510b59c78c3cddf07a9d0294e1dd14c432f7a9c5262f4

See more details on using hashes here.

File details

Details for the file rawfy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: rawfy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for rawfy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f891292e314e8b137127b316fc49e18cf17e9c03b59a6ddc1b876c7f32c08db8
MD5 16418d350cbbbb502bd0c1085b5b01e5
BLAKE2b-256 7fcbce694edd420acd7977f500ad1ff2dd1e72d49aa7c504a7a4622e5688662f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page