Skip to main content

Bitscrape

Bitscrape

Bitscrape

A modular, async Python web scraping framework — simple for a first spider, capable of distributed crawling, storage, search-ranking, and observability for everything after that.

It provides fast async networking, powerful HTML parsing, configurable pipelines, distributed crawling support, and optional browser rendering with Playwright.

Install

pip install bitscrape

or

uv add bitscrape

Documentation

import bitscrape

@bitscrape.spider(name="quotes", start_urls=["https://example.com"])
async def parse(response):
    for quote in response.css("div.quote"):
        yield {
            "text": quote.css("span.text::text").get(),
            "author": quote.css("small.author::text").get(),
        }

bitscrape.run(parse, output="quotes.jsonl")

That same call scales to a Redis-backed, multi-worker distributed crawl by changing one argument — the spider code doesn't change:

bitscrape.run(parse, settings=bitscrape.Settings(
    scheduler_use_redis=True,
    distributed_throttle_enabled=True,
))

Why Bitscrape

  • One function call to run a spider, whether it's a plain decorated function or a full class with multiple callbacks.
  • One Settings object controls everything else — proxy rotation, session pooling, JS rendering, distributed crawling, live monitoring, Prometheus metrics — all opt-in toggles, nothing extra loads unless you ask for it.
  • Respects robots.txt and meta-robots by default, and fails safe (blocks) rather than open (allows) if robots.txt can't be fetched.
  • Every documented feature has a real test behind it — a real local Redis, a real local HTTP server, a real on-disk SQLite database, a real S3 API emulation, real Prometheus/OpenTelemetry libraries. Where something couldn't be verified for real (a live PostgreSQL/MongoDB server, a Kubernetes cluster), that's stated explicitly rather than implied — see CHANGELOG.md and docs/ for exactly what's verified vs. documented.

What's included

Area What you get
Crawling Async fetching (aiohttp), retries with Retry-After support, conditional GET, robots.txt + meta-robots compliance, redirect-loop detection
JS rendering Playwright integration, pooled browser reuse, infinite-scroll helper
Distributed crawling Redis-backed queue + dedup filter, cross-worker-process politeness throttle, a Mercator-style priority Frontier
Extraction CSS/XPath selectors, URL canonicalization, SimHash near-duplicate detection, heuristic entity resolution
Search infrastructure PageRank/HITS link analysis, incremental recrawl scheduling, BM25 + vector hybrid search with Reciprocal Rank Fusion, a knowledge-graph builder
Storage Pluggable backends — SQLite and S3 fully tested, PostgreSQL implemented, MongoDB/Elasticsearch as documented stubs
Extensibility A plugin/hook system (PluginManager), example auth-helper and storage-connector plugins
Observability Real Prometheus metrics, real OpenTelemetry tracing, structured JSON logging, threshold-based alerting, a live local stats dashboard
Deployment Dockerfile, Docker Compose, Kubernetes manifests (Deployment/HPA/Service/PDB)

Explicitly not included, by design: CAPTCHA-solving, browser/TLS fingerprint spoofing, or any other bot-detection evasion tooling. See docs/security/ for why.

Install

python3 -m venv venv
source venv/bin/activate          # Windows: venv\Scripts\Activate.ps1
pip install -e ".[all,dev,cli]"
bitscrape --version

See docs/installation/ for extras, system requirements, and troubleshooting.

Quickstart

bitscrape genspider quotes example.com
bitscrape crawl spiders/quotes.py -o quotes.jsonl

Full walkthrough: docs/quickstart/.

Documentation

Full documentation lives in docs/:

Also at the repository root: ARCHITECTURE.md (condensed system design), API_REFERENCE.md (flat single-page API reference), ROADMAP.md, CHANGELOG.md.

Running the test suite

pytest -q

Expect 440 passed. A handful of tests need a local Redis on port 6390 and a local PostgreSQL server (database bitscrape_test, user/password postgres/postgres) — if it's not running, only those specific tests fail, everything else still passes. See docs/developer-guide/.

Contributing

See CONTRIBUTING.md. Security issues: see SECURITY.md rather than a public issue. Community standards: CODE_OF_CONDUCT.md.

License

MIT — see LICENSE.

Release files for bitscrape 0.8.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 bitscrape 0.8.0
File Size Uploaded
bitscrape-0.8.0.tar.gz 93.5 kB Details

Built distribution (wheel)

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

Total release size: 180.8 kB

Release files / bitscrape-0.8.0.tar.gz

Download URL bitscrape-0.8.0.tar.gz
Size 93.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dd5589a9838d45dab768444801a43e0d431a3b52db6acb7708194089adf7c232
BLAKE2b-256 checksum
How to use checksums
e204b2135177f514c06cbe9597f74d84086ea3d23e60cc85aa75b8d7e28d52d3
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 Aug 9, 2026.

Transparency log

Release files / bitscrape-0.8.0-py3-none-any.whl

Download URL bitscrape-0.8.0-py3-none-any.whl
Size 87.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ceca905265c8ef83345f8d30999b0bf76a36b40c48db674a276acbd2851d2d30
BLAKE2b-256 checksum
How to use checksums
b90e2b76a4bd12d5a6ccea689dac83ba87929ad8504d96bcf39cecf15e9dab51
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 Aug 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.1.6

2 release files

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