Unified Python library for web crawling tools - supports Firecrawl, Crawl4AI, Scrapy, and Browser-Use backends
Project description
🕷️ CrawlStudio
Unified wrapper for web crawling tools, inspired by modular, community-driven design.
🎯 Vision
CrawlStudio provides a unified Python API for various web crawling backends including Firecrawl, Crawl4AI, Scrapy, and Browser-Use (AI-driven). It emphasizes modularity, ease of use, and intelligent extraction capabilities.
📦 Installation
pip install crawlstudio
From source (recommended for contributors):
git clone https://github.com/aiapicore/CrawlStudio.git
cd CrawlStudio
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -e .[dev]
Optional extras for AI browser backend:
pip install .[browser-use]
⚡ Quick Start
- CLI:
crawlstudio https://example.com --backend firecrawl --format markdown --print markdown
- Python:
import asyncio
from crawlstudio import CrawlConfig, FirecrawlBackend
async def main():
cfg = CrawlConfig()
res = await FirecrawlBackend(cfg).crawl("https://example.com", format="markdown")
print(res.markdown)
asyncio.run(main())
🔐 Environment
Create a .env in the project root if using external services/backends:
FIRECRAWL_API_KEY=your_firecrawl_key
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
For Browser-Use backend, you must set at least one of OPENAI_API_KEY or ANTHROPIC_API_KEY.
If you use headless browsers (via browser-use), install Playwright runtime:
python -m pip install playwright
python -m playwright install
🚀 CLI Usage
After install, use the CLI to crawl a URL with different backends and formats:
crawlstudio https://en.wikipedia.org/wiki/Switzerland --backend firecrawl --format markdown --print markdown
crawlstudio https://en.wikipedia.org/wiki/Switzerland --backend crawl4ai --format html --print html
crawlstudio https://en.wikipedia.org/wiki/Switzerland --backend scrapy --format markdown --print markdown
crawlstudio https://en.wikipedia.org/wiki/Switzerland --backend browser-use --format markdown --print markdown
--backend: one offirecrawl,crawl4ai,scrapy,browser-use--format: one ofmarkdown,html,structured--print: choose what to print:summary(default),markdown,html,structured
📘 Usage Examples (API)
The library exposes a unified interface; below are end-to-end examples for each backend.
🧑💻 Python Usage
import asyncio
from crawlstudio import CrawlConfig, FirecrawlBackend
async def main():
config = CrawlConfig()
backend = FirecrawlBackend(config)
result = await backend.crawl("https://en.wikipedia.org/wiki/Switzerland", format="markdown")
print(result.markdown)
asyncio.run(main())
Firecrawl Example
import asyncio
from crawlstudio import CrawlConfig, FirecrawlBackend
async def main():
config = CrawlConfig()
backend = FirecrawlBackend(config)
result = await backend.crawl("https://en.wikipedia.org/wiki/Switzerland", format="markdown")
print(result.markdown)
asyncio.run(main())
Crawl4AI Example
import asyncio
from crawlstudio import CrawlConfig, Crawl4AIBackend
async def main():
config = CrawlConfig()
backend = Crawl4AIBackend(config)
result = await backend.crawl("https://en.wikipedia.org/wiki/Switzerland", format="markdown")
print(result.markdown) # Outputs title, summary, keywords
asyncio.run(main())
Scrapy Example
import asyncio
from crawlstudio import CrawlConfig, ScrapyBackend
async def main():
config = CrawlConfig()
backend = ScrapyBackend(config)
result = await backend.crawl("https://en.wikipedia.org/wiki/Switzerland", format="html")
print(result.raw_html)
asyncio.run(main())
Browser-Use (AI-Driven) Example
import asyncio
from crawlstudio import CrawlConfig, BrowserUseBackend
async def main():
config = CrawlConfig()
backend = BrowserUseBackend(config)
result = await backend.crawl("https://en.wikipedia.org/wiki/Switzerland", format="markdown")
print(result.markdown) # AI-extracted data
asyncio.run(main())
🧪 Tests & Checks
Run the test suite (pytest) and local checks (flake8, mypy):
pytest -q
flake8
mypy crawlstudio
Notes:
- We target Python 3.10+ for typing (PEP 604
X | Yunions). - Third-party libraries without type stubs are ignored by mypy (
ignore_missing_imports = true).
🛠️ Contributing Quickstart
- Fork and clone the repo, create a virtual env, then install dev deps:
git clone https://github.com/aiapicore/CrawlStudio.git
cd CrawlStudio
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
pip install -e .[dev]
- Optional: install pre-commit hooks
pip install pre-commit
pre-commit install
pre-commit run --all-files
- Run the suite before submitting a PR:
flake8
mypy crawlstudio
pytest -q
⚡ Backend Comparison
| Backend | Speed | Cost | AI Intelligence | Best For |
|---|---|---|---|---|
| Firecrawl | Fast | API costs | Medium | Production scraping |
| Crawl4AI | Medium | Free | Medium | Development & testing |
| Scrapy | Fastest | Free | Low | Simple HTML extraction |
| Browser-Use | Slower | AI costs | High | Complex dynamic sites |
🔮 Future Enhancements
Recursive Crawling (Planned)
# Future API - configurable depth and page limits
config = CrawlConfig(
max_depth=3, # Crawl up to 3 levels deep
max_pages_per_level=5, # Max 5 pages per depth level
recursive_delay=1.0, # 1 second delay between requests
follow_external_links=False # Stay within same domain
)
# Recursive crawling with depth control
result = await backend.crawl_recursive("https://example.com", format="markdown")
print(f"Crawled {len(result.pages)} pages across {result.max_depth_reached} levels")
Additional Crawler Backends (Roadmap)
High Priority
- Playwright - Fast browser automation, excellent for SPAs
- Selenium - Industry standard, huge ecosystem
- BeautifulSoup + Requests - Lightweight, simple parsing
Specialized Crawlers
- Apify SDK - Cloud scraping platform
- Colly (via Python bindings) - High-performance Go crawler
- Puppeteer (via pyppeteer) - Headless Chrome control
AI-Enhanced Crawlers
- ScrapeGraphAI - LLM-powered scraping
- AutoScraper - Machine learning-based pattern detection
- WebGPT - GPT-powered web interaction
Enterprise/Commercial
- ScrapingBee - Anti-bot bypass service
- Bright Data - Proxy + scraping platform
- Zyte - Enterprise web data platform
Advanced Features (Future Versions)
- Multi-page crawling with link discovery
- Batch processing for multiple URLs
- CLI tool (
crawlstudio crawl <url>) - Content deduplication and similarity detection
- Rate limiting and respectful crawling policies
- Caching system with Redis/disk storage
- Webhook integrations for real-time notifications
- GraphQL API for programmatic access
- Docker containerization for easy deployment
Development Roadmap
- Core Features (Current): 4 working backends
- Recursive Crawling: Depth-based multi-page crawling
- CLI Tool:
pip install crawlstudio→ command line usage - Additional Backends: Playwright, Selenium, BeautifulSoup
- Enterprise Features: Batch processing, advanced caching
- AI Integration: More AI-powered extraction capabilities
- Cloud Platform: SaaS offering with web interface
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
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 crawlstudio-0.1.1.tar.gz.
File metadata
- Download URL: crawlstudio-0.1.1.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98d163965738892e65aacc4254afbb19f3ed2e60d4685bfddc8414deb88fea45
|
|
| MD5 |
1d1d7bc7733712552cfc059973ade08d
|
|
| BLAKE2b-256 |
d62350f85bb4a64cadb75bdc63ca021b556c301054bf054bb406efb809905adb
|
File details
Details for the file crawlstudio-0.1.1-py3-none-any.whl.
File metadata
- Download URL: crawlstudio-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c01f36f6b27df4ba2cc25718ec90e53cf6417c38d34b59148e5055b1da3c4a2d
|
|
| MD5 |
48f166d65ebf8aa0d50a3a89c2c2f81a
|
|
| BLAKE2b-256 |
00351c94a78d9359927d9e4e8501ef1f420b68ce1da3ec2bc1a4c613e80b2966
|