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, and for Chinese (jieba, 33x on the chain, 28x MinHash) and Japanese (SudachiPy, 4.5x: Sudachi's own analysis, already Rust in SudachiPy, dominates both sides). They also run for Vietnamese (pyvi, 31x chain, 40x MinHash), Thai (pythainlp newmm, 9x chain, 5x MinHash) and every language datatrove gives the Indic NLP tokenizer (16 tokenizers behind 129 language keys, Hindi, Bengali, Tamil, Urdu and more: 14-18x chain, 4-6x MinHash). Korean (Kiwi, a C++ morphological analyzer) and Stanza languages stay on datatrove's code. Filter and MinHash speedups are single-thread throughput on 1,000 FineWeb or FineWeb-2 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, 33,205 in Chinese and Japanese and 44,300 in Vietnamese, Thai and the 16 Indic tokenizers. The tokenizers match datatrove's on 153M tokens in 57 spaCy languages, 21.4M Chinese and Japanese tokens and 58.3M Vietnamese, Thai and Indic tokens.
  • 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 Rust tokenizer (Korean, Stanza languages), to Chinese without jieba 0.42.1 and Japanese without SudachiPy 0.7.0 and SudachiDict-core installed, to pythainlp, indic-nlp-library or pyvi at other versions than the ported ones, to sentence counts the ports don't reproduce, 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.4

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.4
File Size Uploaded Provenance Actions
datatrove_rs-0.1.4.tar.gz 1.4 MB With provenance Details for datatrove_rs-0.1.4.tar.gz

Built distributions (wheels)

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

Total release size: 22.2 MB

Release files / datatrove_rs-0.1.4.tar.gz

Download URL datatrove_rs-0.1.4.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b6a8696b2302b036924757818f9b1fc0f612a289c8d275adcbc433e7c3765b11
BLAKE2b-256 checksum
How to use checksums
693952b69040ffd2486e98c52d71177e12d192c73f9cd6c9984dbb88c0434aa1
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 13, 2026.

Transparency log

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

Download URL datatrove_rs-0.1.4-cp310-abi3-win_amd64.whl
Size 4.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
637c7f97f2440f020f14d7f8e2fb43727050c21abb18004bcd914b7c7cdb144e
BLAKE2b-256 checksum
How to use checksums
8498567d7e8813083d68bdddc9e7db7f9c0bb82447a7ab54854bb1bc0a3fa1a6
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 13, 2026.

Transparency log

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

Download URL datatrove_rs-0.1.4-cp310-abi3-manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
fb520e2dbab3c5ab2147240c6bfd957c0ef0d4da7b53f4a0b58ef53b249133ba
BLAKE2b-256 checksum
How to use checksums
55137b029b1ef55e72dcb5a95838379df0a8becfd0451078a4be59009af6a4a4
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 13, 2026.

Transparency log

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

Download URL datatrove_rs-0.1.4-cp310-abi3-manylinux_2_28_aarch64.whl
Size 4.1 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
6d643a4880da7210a90030b689b1c979e3bbebeb1a8c90c20c3c477ac03fe7e2
BLAKE2b-256 checksum
How to use checksums
53a77cb300800c51f7eda37b6c8aa0df5c802a8c047be403459266ce05a71e7e
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 13, 2026.

Transparency log

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

Download URL datatrove_rs-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
Size 4.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f732df3350bd8d317a1834bd69eaa05a1c96e1cab6ecfbf72cee71efba632d78
BLAKE2b-256 checksum
How to use checksums
ff889a829c3a4c7895e1431aba02d33f160fe06bf2749cd784e2986c22acb787
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 13, 2026.

Transparency log

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

Download URL datatrove_rs-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl
Size 4.1 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b8b35d44797cd5d4676429425109961df2b0435a46d7de3903b67dba0cc4932e
BLAKE2b-256 checksum
How to use checksums
51fdc03e05de8e9b606fae048a5276b322008f168fa08aa611e1c7b3c5379c55
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 13, 2026.

Transparency log

Security for datatrove-rs 0.1.4

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.4.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 13, 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