Metadata-Version: 2.4
Name: stripfeed
Version: 1.0.0
Summary: Official Python SDK for StripFeed - convert any URL to clean Markdown
Author: StripFeed
License-Expression: MIT
Project-URL: Homepage, https://www.stripfeed.dev
Project-URL: Documentation, https://www.stripfeed.dev/docs
Project-URL: Repository, https://github.com/StripFeed/stripfeed-python
Project-URL: Issues, https://github.com/StripFeed/stripfeed-python/issues
Keywords: stripfeed,markdown,web-scraping,ai,llm,rag,readability,html-to-markdown,api,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# StripFeed Python SDK

Official Python SDK for [StripFeed](https://www.stripfeed.dev) - convert any URL to clean, token-efficient Markdown for AI agents, RAG pipelines, and LLM workflows.

## Install

```bash
pip install stripfeed
```

## Quick Start

```python
from stripfeed import StripFeed

sf = StripFeed("sf_live_your_api_key")

# Full result with metadata
result = sf.fetch("https://news.ycombinator.com")
print(result["markdown"])
print(f"Tokens: {result['tokens']} (saved {result['savingsPercent']}%)")

# Just the Markdown string
md = sf.fetch_markdown("https://news.ycombinator.com")
```

## With Options

```python
result = sf.fetch(
    "https://example.com",
    selector="article",           # CSS selector (Pro)
    format="json",                # json, text, html (Pro)
    model="claude-sonnet-4-6",    # cost tracking
    cache=False,                  # bypass cache
    ttl=7200,                     # custom cache TTL
)
```

## Batch (Pro plan)

```python
result = sf.batch(
    [
        "https://example.com",
        {"url": "https://docs.anthropic.com", "selector": "article"},
    ],
    model="claude-sonnet-4-6",
)

for item in result["results"]:
    print(f"{item['url']}: {item['tokens']} tokens")
```

## Error Handling

```python
from stripfeed import StripFeed, StripFeedError

try:
    result = sf.fetch("https://example.com")
except StripFeedError as e:
    print(f"API error {e.status}: {e}")
```

## Configuration

```python
sf = StripFeed(
    "sf_live_your_api_key",
    base_url="https://custom.api/v1",  # optional
    timeout=10,                         # optional, default 30s
)
```

## Methods

- `sf.fetch(url, **options)` - Fetch URL, return full result dict (markdown, tokens, metadata)
- `sf.fetch_markdown(url, **options)` - Fetch URL, return only Markdown string
- `sf.batch(urls, model=None)` - Fetch up to 10 URLs in parallel (Pro plan)

## Requirements

- Python 3.9+
- No external dependencies

## Links

- [Documentation](https://www.stripfeed.dev/docs)
- [Dashboard](https://www.stripfeed.dev/dashboard)
- [GitHub](https://github.com/StripFeed/stripfeed-python)
- [TypeScript SDK](https://www.npmjs.com/package/stripfeed)
