Skip to main content

silkworm-rs

PyPI - Version Tests Docs PyPI Downloads

Silkworm is an async-first Python web scraping framework built on wreq and scraper-rs. It combines a small, typed Spider/Request/Response API with middleware, output pipelines, and production crawl controls.

Documentation · Getting started · Examples · API reference

Highlights

  • Async crawling with concurrency, priorities, request deduplication, timeouts, and deadlock-free queue backpressure.
  • Browser-impersonating HTTP through wreq, with redirects, proxies, cookies, retries, throttling, and robots.txt support.
  • Push-style typed callbacks using await self.emit(...) and await response.follow(...).
  • Async CSS/XPath selection and optional declarative Item, Text, and Attr extraction.
  • File, database, cloud, queue, and message-stream pipelines, with batch processing available on every built-in pipeline.
  • Production controls for failure policies, stop limits, pause/resume, caching, graceful shutdown, metrics, and structured crawl statistics.
  • Optional CDP, Servo, and OnionLink clients for rendered or onion-service pages.

Install

Silkworm supports Python 3.13–3.15.

pip install silkworm-rs

With uv:

uv add silkworm-rs

Integrations are installed as optional extras. For example:

pip install "silkworm-rs[rsloop,polars]"

See Getting Started for the complete extras and Python-version compatibility table.

Quick start

from silkworm import HTMLResponse, Response, Spider, run_spider
from silkworm.pipelines import JsonLinesPipeline


class QuotesSpider(Spider):
    name = "quotes"
    start_urls = ("https://quotes.toscrape.com/",)

    async def parse(self, response: Response) -> None:
        if not isinstance(response, HTMLResponse):
            return

        for quote in await response.select(".quote"):
            text = await quote.select_first(".text")
            author = await quote.select_first(".author")
            if text is not None and author is not None:
                await self.emit({"text": text.text, "author": author.text})

        next_link = await response.select_first("li.next > a")
        if next_link is not None and (href := next_link.attr("href")):
            await response.follow(href, callback=self.parse)


run_spider(
    QuotesSpider,
    item_pipelines=[JsonLinesPipeline("data/quotes.jl")],
)

Callbacks return None; they report items and requests with emit and follow, which apply backpressure while the callback is running.

Command line

Run a spider module or test its parser without writing a runner script:

silkworm crawl examples/quotes_spider.py -o data/quotes.jl -s max_items=100
silkworm parse https://quotes.toscrape.com/ --spider examples/quotes_spider.py

See the CLI reference for configuration, output formats, and exit codes.

Documentation

Topic Guide
Installation, extras, and first spider Getting Started
Spider, request, response, selectors, and callbacks Core Concepts
Declarative item extraction Declarative Extraction
Engine, HTTP, CDP, Servo, and OnionLink Engine and HTTP Client
Request and response middleware Middlewares
Output destinations and batch processing Pipelines
asyncio, rsloop, uvloop, winloop, and Trio Runners
Resumable and observable crawls Production Crawling
Version changes Migration Guide
Constraints and workarounds Limitations

Development

uv venv --python python3.13
uv sync --group dev
just fmt && just lint && just typecheck && just test

See the development workflow and open an issue or pull request on GitHub.

Acknowledgements

Silkworm builds on wreq, scraper-rs, fast-h2m, turboxml, and optional integrations including OnionLink and Servo. Thank you to their maintainers and contributors.

License

MIT. See LICENSE.

Metadata

Release files for silkworm-rs 0.14.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for silkworm-rs 0.14.2
File Size Uploaded
silkworm_rs-0.14.2.tar.gz 481.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for silkworm-rs 0.14.2
File Interpreter ABI Platform
silkworm_rs-0.14.2-py3-none-any.whl Python 3 none any Details

Total release size: 672.3 kB

Release files / silkworm_rs-0.14.2.tar.gz

Download URL silkworm_rs-0.14.2.tar.gz
Size 481.4 kB
Tags Source
SHA-256 checksum
How to use checksums
10ed6077a7fd047e4a5f34a843636f58d20c2529191bbc348fb8e7c6d83dd87f
BLAKE2b-256 checksum
How to use checksums
ac390e1272d08ed91e72d56c3dc626d19b626983ae85d07c8adb5a462d54a19c
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 Sep 30, 2026.

Transparency log

Release files / silkworm_rs-0.14.2-py3-none-any.whl

Download URL silkworm_rs-0.14.2-py3-none-any.whl
Size 190.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2f17b64ad2752e9dd05d125f525e053653fcfde6bf765ee280d8584c5a3b7f1
BLAKE2b-256 checksum
How to use checksums
78003695a85c0dc6bb5200acbe00f82bb9e3ad43ac4184b84ec578e37b775fd6
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 Sep 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.14.2 This release

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.41

2 release files

0.2.39

2 release files

0.2.38

2 release files

0.2.36

2 release files

0.2.34

2 release files

0.2.33

2 release files

0.2.32

2 release files

0.2.31

2 release files

0.2.30

2 release files

0.2.28

2 release files

0.2.27

2 release files

0.2.26

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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