Official Python SDK for StripFeed - convert any URL to clean Markdown
Project description
StripFeed Python SDK
Official Python SDK for StripFeed - convert any URL to clean, token-efficient Markdown for AI agents, RAG pipelines, and LLM workflows.
Install
pip install stripfeed
Quick Start
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
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
max_tokens=5000, # truncate to token budget
)
Batch (Pro plan)
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")
Check Usage
usage = sf.usage()
print(f"Plan: {usage['plan']}")
print(f"Used: {usage['usage']} / {usage['limit']}")
print(f"Remaining: {usage['remaining']}")
Error Handling
from stripfeed import StripFeed, StripFeedError
try:
result = sf.fetch("https://example.com")
except StripFeedError as e:
print(f"API error {e.status}: {e}")
Configuration
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 stringsf.batch(urls, model=None)- Fetch up to 10 URLs in parallel (Pro plan)sf.usage()- Check current monthly API usage and plan limits
Requirements
- Python 3.9+
- No external dependencies
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stripfeed-1.1.0.tar.gz
(7.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stripfeed-1.1.0.tar.gz.
File metadata
- Download URL: stripfeed-1.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24aef01bfd686011908d5ff651b7413ccbd13b37af630dac344ac226c26e66fd
|
|
| MD5 |
c5fd8b4e349e49c61bd8daafe47b23f8
|
|
| BLAKE2b-256 |
31662b0b2dc1af9435425b6aed6a385b7c4d6b6feac6c6c164d84ee4fa631753
|
File details
Details for the file stripfeed-1.1.0-py3-none-any.whl.
File metadata
- Download URL: stripfeed-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5e377416fef7e31288000e3c17628e1d6218489b2305a601e5422002d75b44d
|
|
| MD5 |
440acb5f6c0579e1f9c78ca7976d2806
|
|
| BLAKE2b-256 |
af514891adbe3f500771e3a89734e2553e3c461ef395f134cbc21d4d3cf40120
|