Skip to main content

datatrove-rs

PyPI Python versions CI License

Rust implementations of the hot steps in datatrove pipelines, with byte-identical output. Turn it on with one environment variable, keep your pipeline code as it is, and the FineWeb recipe runs about 5x faster.

FineWeb recipe on 5,000 Common Crawl pages: datatrove 87.7 s, datatrove-rs 17.3 s

Installation

pip install "datatrove-rs[trafilatura]"

The [trafilatura] extra adds trafilatura-rs for HTML extraction, which is where most of the recipe's time goes. Leave the extra off to accelerate only the filters and MinHash.

Requires Python 3.10+ and datatrove >=0.10.1,<0.11. Wheels are built for Linux, macOS and Windows.

Quickstart

Your existing pipeline, unchanged:

DATATROVE_RS=1 python my_pipeline.py

That's it. Any step datatrove-rs covers runs in Rust; every other step runs datatrove's own code. The switch also reaches executor worker processes.

Prefer it in code? Either of these works too:

import datatrove_rs
datatrove_rs.patch()  # datatrove's own imports now return the Rust-backed steps

# or import from the mirror: any `datatrove.X` module is available as `datatrove_rs.X`
from datatrove_rs.pipeline.filters import GopherQualityFilter, URLFilter

You can also run a script unmodified with python -m datatrove_rs my_pipeline.py.

What's accelerated

datatrove step Speedup Notes
extractors.Trafilatura ~7x via trafilatura-rs, with the [trafilatura] extra
filters.GopherRepetitionFilter 87x
filters.GopherQualityFilter 79x
filters.C4QualityFilter 49x
filters.FineWebQualityFilter 86x
dedup.MinhashDedupSignature 48x MinHash stage 1
dedup.MinhashDedupCluster 14-24x MinHash stage 3; 2.7-3.3x less peak memory
formatters.PIIFormatter 9-16x
formatters.FTFYFormatter 21-34x skips ftfy where it provably changes nothing; the rest still runs ftfy
filters.C4BadWordsFilter 13x
readers.WarcReader ~2.2x gzip WARCs; charset detection stays in Python
filters.URLFilter ~7x mostly blocklist loading and tldextract setup
filters.LanguageFilter ~1.3x the rest is fastText's own C++ inference

Filters and MinHash stage 1 run in Rust for the 57 languages spaCy tokenizes with rules (English plus German, French, Spanish, Russian, Italian, Portuguese, Polish, Dutch, Turkish, Indonesian and 46 more), with 53-88x on the four-filter chain in the ten largest. Filter and MinHash speedups are single-thread throughput on 1,000 FineWeb documents. Trafilatura's is inside the full pipeline; reader, URL and language numbers are CPU time on 5,000 Common Crawl records. MinHash stage 3 is CPU time on 37M duplicate pairs over 4.5M documents (default flags / with cluster ids and sizes); the formatters and C4BadWordsFilter on 12,000 FineWeb and 12,000 FineWeb-2 documents. Full numbers and method: docs/fineweb-profile.md.

Each replacement subclasses the datatrove step, takes the same arguments and produces the same results: keep/drop decisions, drop reasons, rewritten text, stats, and MinHash signature and cluster files. Pickled pipelines work on Slurm and local multiprocessing workers whether or not the worker patched.

Exactness

Output equality with datatrove is the product, so every change is checked against unmodified datatrove:

  • Filters and MinHash: 10,500 real, perturbed and fuzzed documents across 26 configurations, 0 mismatches, plus 81,825 FineWeb-2 and fuzzed documents across the 56 other languages. The spaCy-compatible tokenizer matches spaCy on 153M tokens in 57 languages.
  • Trafilatura: 10,666 of 10,666 Common Crawl pages identical (see trafilatura-rs).
  • End to end: the FineWeb recipe gives identical output on 5,000 Common Crawl records.

When the Rust path can't guarantee identical results, the step falls back to datatrove's own code for that case. This applies to languages without a rule-based spaCy tokenizer (Chinese, Japanese, Vietnamese, Korean, Thai and others) and to Trafilatura options trafilatura-rs doesn't cover. Details and reproduced quirks are in docs/parity.md.

Contributing

Development setup, the parity harness, benchmarks and releasing: CONTRIBUTING.md.

License

Apache-2.0, like datatrove. datatrove-rs is an independent project and is not affiliated with Hugging Face.

Metadata

Release files for datatrove-rs 0.1.3

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

Source distribution (sdist)

Source distribution for datatrove-rs 0.1.3
File Size Uploaded Provenance Actions
datatrove_rs-0.1.3.tar.gz 785.1 kB With provenance Details for datatrove_rs-0.1.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for datatrove-rs 0.1.3
File Actions
datatrove_rs-0.1.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for datatrove_rs-0.1.3-cp310-abi3-win_amd64.whl
datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_x86_64.whl
datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_aarch64.whl
datatrove_rs-0.1.3-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for datatrove_rs-0.1.3-cp310-abi3-macosx_11_0_arm64.whl
datatrove_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for datatrove_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 16.6 MB

Release files / datatrove_rs-0.1.3.tar.gz

Download URL datatrove_rs-0.1.3.tar.gz
Size 785.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4c59e069b31d82e9f1d3de3bb22ba4a10495da72ffba9d580decd5a1717c7c04
BLAKE2b-256 checksum
How to use checksums
36b9491a4d5022c11bd5c8aa3130825e4abd7470029637585f00fd48df169989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / datatrove_rs-0.1.3-cp310-abi3-win_amd64.whl

Download URL datatrove_rs-0.1.3-cp310-abi3-win_amd64.whl
Size 3.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
16114f4af5adc80364dfc83484188bca8938bdf04adf4e2ab49bb6394e236c2a
BLAKE2b-256 checksum
How to use checksums
b6157ee8f95143e0bde9755e4a7d612d6c9ae2e482154f8a9bf2fc3e0680d3d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d4615089e976f1fdb815a8af21c65e3dd2ecb7b2535892b689f422a784a29dc1
BLAKE2b-256 checksum
How to use checksums
ed295ec5f51a75eefe7e98504ef5d91fd97c6e6a06eb907cecb1e6e9f341ec5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL datatrove_rs-0.1.3-cp310-abi3-manylinux_2_28_aarch64.whl
Size 3.2 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
050f7460dd538452613cd3f742b2cf4c2a7f065304852f8037785b7f5c4e2f0d
BLAKE2b-256 checksum
How to use checksums
c7bbb95895bd124ec0b75f0772366f6158101ce0eab47454e6dd68adf8354d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / datatrove_rs-0.1.3-cp310-abi3-macosx_11_0_arm64.whl

Download URL datatrove_rs-0.1.3-cp310-abi3-macosx_11_0_arm64.whl
Size 3.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
37a7d266325413d302ed7322c8d2c6efabefa7f667862688a4708f713766ec6e
BLAKE2b-256 checksum
How to use checksums
206b854672b0dd6111b1c5f4d625ce2e28021a67780e9a092bdd7ac47f3232b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / datatrove_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl

Download URL datatrove_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl
Size 3.1 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
be3a836700f85835e572dc0028cb6f0d3ac85a1ee75b307dc5c07d09e59a2a3d
BLAKE2b-256 checksum
How to use checksums
a8f2a7e885b980f0a7e7fcb3a1b6a531249b35ffc9da25c94abcc465e397522d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for datatrove-rs 0.1.3

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for datatrove_rs-0.1.3.tar.gz

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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