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, rxml, 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.1

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.1
File Size Uploaded
silkworm_rs-0.14.1.tar.gz 481.7 kB Details

Built distribution (wheel)

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

Total release size: 672.5 kB

Release files / silkworm_rs-0.14.1.tar.gz

Download URL silkworm_rs-0.14.1.tar.gz
Size 481.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e02878bf79c1d1857c095ae2ffca4b683f55357cbeecc7e337160e2771afc18e
BLAKE2b-256 checksum
How to use checksums
d8c7638538df2f43a23cd62de49354c77118e6a31eeb308a2ef0e26293636c7f
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.1-py3-none-any.whl

Download URL silkworm_rs-0.14.1-py3-none-any.whl
Size 190.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ccedcf0e73a67d1dcfa08e007af703ab7e6a3e3163e6e6114e48cf27438214b
BLAKE2b-256 checksum
How to use checksums
07f788268e1e63e6519bd93305f16381dffb1aab32df093d87ca6c152398f5e1
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

0.14.2

2 release files

This release

0.14.1 This release

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