Metadata-Version: 2.4
Name: pyroid
Version: 1.1.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Archiving
Classifier: Topic :: Text Processing
Classifier: Topic :: Text Processing :: Filters
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: Typing :: Typed
Requires-Dist: pyroid[fasttext,datasketch,cli,nemo] ; extra == 'all'
Requires-Dist: pyroid[datatrove,hf,warc] ; python_full_version < '3.15' and extra == 'all'
Requires-Dist: pyarrow>=18 ; extra == 'cli'
Requires-Dist: numpy>=1.26 ; extra == 'cli'
Requires-Dist: numpy>=1.26 ; extra == 'datasketch'
Requires-Dist: datatrove>=0.10.1 ; extra == 'datatrove'
Requires-Dist: regex ; extra == 'datatrove'
Requires-Dist: tokenizers ; extra == 'datatrove'
Requires-Dist: numpy>=1.26 ; extra == 'datatrove'
Requires-Dist: orjson>=3.2 ; extra == 'datatrove'
Requires-Dist: numpy>=1.26 ; extra == 'fasttext'
Requires-Dist: datasets>=3 ; extra == 'hf'
Requires-Dist: pyarrow>=18 ; extra == 'hf'
Requires-Dist: numpy>=1.26 ; extra == 'hf'
Requires-Dist: numpy>=1.26 ; extra == 'nemo'
Requires-Dist: faust-cchardet ; extra == 'warc'
Requires-Dist: python-magic ; extra == 'warc'
Provides-Extra: all
Provides-Extra: cli
Provides-Extra: datasketch
Provides-Extra: datatrove
Provides-Extra: fasttext
Provides-Extra: hf
Provides-Extra: nemo
Provides-Extra: warc
License-File: LICENSE
License-File: LICENSES/Apache-2.0.txt
License-File: LICENSES/BSD-2-Clause-justext.txt
License-File: LICENSES/BSD-3-Clause-dateutil.txt
License-File: LICENSES/BSD-3-Clause-lxml.txt
License-File: LICENSES/BSD-3-Clause-sqlparse.txt
License-File: LICENSES/ISC-anyascii.txt
License-File: LICENSES/MIT-libxml2.txt
License-File: LICENSES/PSF-2.0.txt
License-File: LICENSES/THIRD-PARTY-RUST.txt
License-File: LICENSES/Unicode-3.0.txt
License-File: NOTICE
Summary: Faster Rust versions of PyYAML, jmespath, tabulate, python-dateutil, difflib, packaging, sqlparse, ftfy, fastText, langdetect, Trafilatura, datatrove and other popular Python libraries, with the same API and output
Keywords: rust,pyo3,ftfy,json-repair,datasketch,minhash,nltk,jieba,tokenizer,trafilatura,web-scraping,warc,yaml,pyyaml,tabulate,markdown,fasttext,datatrove,rouge,bleu,nlp,text-cleaning,deduplication,llm
Author: Andrew Odendaal
License-Expression: MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND PSF-2.0 AND Unicode-3.0 AND Zlib
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/ao/pyroid/blob/main/CHANGELOG.md
Project-URL: Documentation, https://ataiva.com/open-source/pyroid/docs/
Project-URL: Homepage, https://github.com/ao/pyroid
Project-URL: Issues, https://github.com/ao/pyroid/issues
Project-URL: Repository, https://github.com/ao/pyroid

# pyroid

[![PyPI](https://img.shields.io/pypi/v/pyroid)](https://pypi.org/project/pyroid/)
[![Python versions](https://img.shields.io/pypi/pyversions/pyroid)](https://pypi.org/project/pyroid/)
[![License](https://img.shields.io/pypi/l/pyroid)](https://github.com/ao/pyroid/blob/main/LICENSE)
[![CI](https://github.com/ao/pyroid/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ao/pyroid/actions/workflows/ci.yml)

[Docs](https://ataiva.com/open-source/pyroid/docs/) | [Benchmarks](https://ataiva.com/open-source/pyroid/docs/benchmarks/) | [Compatibility](https://ataiva.com/open-source/pyroid/docs/compatibility/)

pyroid reimplements 21 popular Python libraries in Rust, with the same API and the same output.
Most of its modules are many times faster than the library they replace. They cover data formats
(JSON, YAML, JMESPath queries, dates, tables), developer tools (difflib, packaging, sqlparse), text
and NLP (ftfy, fastText, langdetect, NLTK, jieba), web pages and archives, and the steps of LLM data
pipelines.

```console
$ pip install pyroid
```

Change the import. The output is the same:

```python
import pyroid.yaml as yaml  # was: import yaml
import pyroid.jmespath as jmespath  # was: import jmespath
import pyroid.ftfy as ftfy  # was: import ftfy
from pyroid.packaging.version import Version  # was: from packaging.version import Version

yaml.safe_load("ports: [80, 443]")  # {'ports': [80, 443]}
jmespath.search("items[?up].name", {"items": [{"name": "web", "up": True}]})  # ['web']
ftfy.fix_text_batch(["naÃ¯ve rÃ©sumÃ©", "ok"])  # ['naïve résumé', 'ok'], on all cores
Version("1.10") > Version("1.9")  # True
```

For code you don't own, `pyroid.patch("yaml", "jmespath")` makes its `import yaml` and
`import jmespath` use pyroid's functions (boto3 and the AWS CLI query through jmespath).

On an AWS EC2 c7i.4xlarge, `yaml.safe_load` is 10× faster than PyYAML's `CSafeLoader` on 11,878
real YAML files, `jmespath.search` 10 to 26× faster than jmespath 1.1.0 on single queries of a
boto3-style response, and `ftfy.fix_text_batch` 108× faster than ftfy 6.3.1 on one thread over
10,000 FineWeb documents. [Speed by module](#speed-by-module) has every module's numbers.

| Area | Module | Replaces |
|---|---|---|
| Data formats | [`pyroid.json_repair`](https://ataiva.com/open-source/pyroid/docs/guides/json_repair/) | json_repair 0.64.9 |
| | [`pyroid.yaml`](https://ataiva.com/open-source/pyroid/docs/guides/yaml/) | PyYAML 6.0.3's `safe_load` and `safe_dump` (its pure-Python `SafeLoader` and `SafeDumper`) |
| | [`pyroid.jmespath`](https://ataiva.com/open-source/pyroid/docs/guides/jmespath/) | jmespath 1.1.0 (`search`, `compile`, custom functions), as boto3, the AWS CLI and Ansible use it |
| | [`pyroid.tabulate`](https://ataiva.com/open-source/pyroid/docs/guides/tabulate/) | tabulate 0.10.0, `DataFrame.to_markdown()` included |
| | [`pyroid.dateutil.parser`](https://ataiva.com/open-source/pyroid/docs/guides/dateutil/) | python-dateutil's `parse` and `isoparse` (2.8.2 to 4.0.0) |
| Developer tools | [`pyroid.difflib`](https://ataiva.com/open-source/pyroid/docs/guides/difflib/) | the standard library's `difflib` (CPython 3.11 to 3.15): `SequenceMatcher`, `get_close_matches`, `unified_diff`, `ndiff`, `HtmlDiff` |
| | [`pyroid.packaging`](https://ataiva.com/open-source/pyroid/docs/guides/packaging/) | packaging 26.3's versions, specifiers, markers, requirements and name helpers (PEP 440, PEP 508) |
| | [`pyroid.sqlparse`](https://ataiva.com/open-source/pyroid/docs/guides/sqlparse/) | sqlparse 0.6.1 (`format`, `split`, `parse`, with sqlparse's own token classes) |
| Text and encoding | [`pyroid.ftfy`](https://ataiva.com/open-source/pyroid/docs/guides/ftfy/) | ftfy 6.3.1 |
| | [`pyroid.translit`](https://ataiva.com/open-source/pyroid/docs/guides/translit/) | anyascii 0.3.3; a permissively licensed alternative to Unidecode |
| Language ID and NLP | [`pyroid.fasttext`](https://ataiva.com/open-source/pyroid/docs/guides/fasttext/) | fastText 0.9.2 inference (fasttext, fasttext-wheel, fasttext-predict) |
| | [`pyroid.nltk`](https://ataiva.com/open-source/pyroid/docs/guides/nltk/) | NLTK 3.10.4's `sent_tokenize` (Punkt), `word_tokenize` and Treebank tokenizers |
| | [`pyroid.jieba`](https://ataiva.com/open-source/pyroid/docs/guides/jieba/) | jieba 0.42.1 (Chinese word segmentation) |
| | [`pyroid.langdetect`](https://ataiva.com/open-source/pyroid/docs/guides/langdetect/) | langdetect 1.0.9, with the same results for the same seed |
| Web and archives | [`pyroid.trafilatura`](https://ataiva.com/open-source/pyroid/docs/guides/trafilatura/) | Trafilatura's text extraction: 2.3.1, or 1.11.0 as datatrove 0.10.1 installs it (with lxml 6.1.3's HTML parser and jusText 3.0.2) |
| | [`pyroid.warc`](https://ataiva.com/open-source/pyroid/docs/guides/warc/) | warcio 1.8.2's WARC/ARC reader (`ArchiveIterator`), and datatrove 0.10.1's WARC reading (`WarcReader`) |
| LLM data: filters and dedup | [`pyroid.filters`](https://ataiva.com/open-source/pyroid/docs/guides/filters/) | datatrove 0.10.1's Gopher, C4, FineWeb, PII, C4 bad-words, symbol-lines and URL filters |
| | [`pyroid.dedup`](https://ataiva.com/open-source/pyroid/docs/guides/dedup/) | datatrove 0.10.1's MinHash and sentence dedup |
| | [`pyroid.datasketch`](https://ataiva.com/open-source/pyroid/docs/guides/datasketch/) | datasketch 2.0.0's MinHash, LeanMinHash, MinHashLSH, LSH Forest and LSH Ensemble |
| | [`pyroid.nemo`](https://ataiva.com/open-source/pyroid/docs/guides/nemo-curator/#pyroidnemo) | NeMo Curator 1.4.0's heuristic document filters and string modifiers |
| Evaluation | [`pyroid.metrics`](https://ataiva.com/open-source/pyroid/docs/guides/metrics/) | rouge-score 0.1.2; sacrebleu 2.6.0's BLEU, chrF and chrF++ |

## Example: cleaning LLM training data

The end-to-end benchmarks run datatrove's FineWeb pipeline. Without text extraction, they run a
FineWeb-style chain: ftfy, then the pipeline's fastText language ID, Gopher, C4 and FineWeb quality
filters and MinHash dedup.
On 100,000 FineWeb documents on AWS EC2 c7i.4xlarge, pyroid's version of the chain is 27× faster
than datatrove on 8 processes, with the same output.

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ao/pyroid/main/docs/assets/hero-dark.svg">
  <img alt="Wall time to clean the 10,000-document FineWeb dev slice with identical output on AWS EC2 c7i.4xlarge: pyroid takes 1.9 s with 8 threads, 18× faster than datatrove's 35 s with 8 processes, and 5.6 s with 1 thread, 38× faster than datatrove's 213 s with 1 process" src="https://raw.githubusercontent.com/ao/pyroid/main/docs/assets/hero-light.svg">
</picture>

<sub>The chain without text extraction, on the first 10,000 documents of the pinned FineWeb slice,
with 1 and 8 processes or threads pinned to 8 CPUs. datatrove 0.10.1 (ftfy 6.3.1,
fasttext-predict 0.9.2.4, spaCy 3.8.18) on CPython 3.13.18; pyroid's native chain on free-threaded
CPython 3.15.2. Same output, document for document. On the 100k corpus the ratios are 27× and
56×.</sub>

`pyroid clean` runs the chain over Parquet or JSONL files:

```console
$ pip install "pyroid[cli]"
$ pyroid clean in.parquet out.parquet --recipe fineweb   # ftfy, then FineWeb's filters and MinHash
```

pyroid's stages also drop into datatrove's own executor. There the chain runs 11.2× faster at 8
processes on the dev slice, and 13.6× on 100k documents.

From Common Crawl WARC files, the pipeline also extracts the text with Trafilatura. On 8 WARC files
of CC-MAIN-2026-39 (171,595 pages), on a c7i.4xlarge with 8 workers, stock datatrove took 848.3 s.
With pyroid's steps in datatrove it took 89.4 s (9.5×), and `pyroid clean --recipe fineweb-warc`
took 79.6 s (10.7×). Both keep the same documents as stock datatrove, apart from the pages it
drops at its 1 s extraction timeout
([benchmarks](https://ataiva.com/open-source/pyroid/docs/benchmarks/#from-warc-files-datatroves-fineweb-pipeline)).

## Same output, checked

Each module is tested against the library it replaces, on pinned real data and with
property-based fuzzing. The comparisons are exact: `pyroid.ftfy` is byte-identical to ftfy 6.3.1,
and the metrics match rouge-score and sacrebleu to the last digit. fastText's labels and
probabilities are bit-identical to its C++ code on Linux (glibc) and Windows x64; on macOS the
probabilities can differ in the last bits. The
[compatibility page](https://ataiva.com/open-source/pyroid/docs/compatibility/) has the counts for every module,
and each guide lists its known differences.

CI runs the `parity/` suites on Linux x86_64 and aarch64, and most of them have also run natively
on AWS EC2 ([platforms](https://ataiva.com/open-source/pyroid/docs/compatibility/#platforms)). On macOS, Windows
and musl Linux, every release's wheels pass pyroid's test suite before they are published.

Where a module doesn't port an option or input, it hands the call to the real library with a
`pyroid.FallbackWarning`, or raises.

Results don't depend on the number of threads or workers, or on how loaded the machine is. Stock
datatrove's do: its Trafilatura step gives up on a page after 1 s, so two runs over the same WARC
files can keep different documents. pyroid has no timeout.

## Differences from the originals

Batch functions take a `str`, a `list` or `tuple` of `str`, or an Arrow string column (pyarrow,
polars, pandas, Hugging Face `datasets`), and return text and masks in the same kind. They release the GIL and run on all
cores, so threads replace worker processes, and every thread shares one loaded fastText model
instead of a copy per process.

Wheels cover CPython 3.11 to 3.15 and free-threaded 3.14t and 3.15t, on Linux (glibc and musl),
macOS and Windows, for x86-64 and ARM64, so no compiler is needed. The core has no runtime
dependencies; `pyroid.fasttext`, `pyroid.datasketch` and the batch calls of `pyroid.nemo` need
numpy (`pip install "pyroid[fasttext]"`, `"pyroid[datasketch]"`, `"pyroid[nemo]"`).

## Speed by module

pyroid on one thread against the library it replaces in one process, on the 10,000-document
FineWeb dev slice, AWS EC2 c7i.4xlarge:

| pyroid | Against | Speedup |
|---|---|---:|
| `ftfy.fix_text_batch` | ftfy 6.3.1 | 108× |
| `fasttext` `predict`, `lid.176.bin` / `lid.176.ftz` | fasttext-predict 0.9.2.4 | 1.6× / 3.6× |
| `filters`, Gopher, C4 and FineWeb quality | datatrove 0.10.1 | 35–69× |
| `dedup`, MinHash signatures | datatrove 0.10.1 | 34× |
| `translit.anyascii` | anyascii 0.3.3 | 53× |

`pyroid.yaml`, on 11,878 real YAML files (343 MB: GitHub Actions workflows, Kubernetes and Helm
files, OpenAPI specs, model cards) on AWS EC2 c7i.4xlarge: `safe_load` runs 10× faster than
PyYAML's `CSafeLoader` and 44× faster than its default `SafeLoader`; `safe_dump` 5.4× faster than
`CSafeDumper` and 21× faster than `SafeDumper`.

`pyroid.tabulate`, on AWS EC2 c7i.4xlarge: 19 to 32× faster than tabulate 0.10.0 on 1,000-row
tables and 12 to 22× on 100,000 rows, in five output formats; 6 to 10× on a 5-row table.

`pyroid.dateutil`, on 608,343 real date strings on AWS EC2 c7i.4xlarge: `parser.parse` runs 15×
faster than python-dateutil 2.9.0.post0 in a loop of single calls, and `parse_batch` to Arrow
37× faster on one thread and 101× on 16.

`pyroid.jmespath`, on AWS EC2 c7i.4xlarge: 10 to 26× faster than jmespath 1.1.0 on single
queries of a boto3-style response, 7 to 20× over 10,000 records.

`pyroid.difflib`, on AWS EC2 c7i.4xlarge: 6 to 15× faster than the standard library's difflib
on diffs of real source files, 12 to 15× on `get_close_matches` on one thread (up to 31× on 16
threads), with the same results.

`pyroid.packaging`, on AWS EC2 c7i.4xlarge: 3 to 8× faster than packaging 26.3 on `Version()`, 8×
on `SpecifierSet.contains`, 17× on `filter` over a release list, 21× on parsing markers and 6 to
7× on requirements.

`pyroid.sqlparse`, on AWS EC2 c7i.4xlarge: 15 to 68× faster than sqlparse 0.6.1 per `format()`
call, 29 to 134× per `split()` and 12.5 to 16.5× per `parse()`; over 20,000 real SQL documents,
28×, 44× and 5×.

`pyroid.langdetect`, on AWS EC2 c7i.4xlarge: 35 to 49× faster than langdetect 1.0.9 per call on
texts of 50 to 12,000 characters, with the same languages and probabilities for the same seed, and
158 to 246× with `detect_batch` on 8 threads.

The other modules have only been measured in a Docker VM on a Mac or on a shared EC2 machine,
so treat these as indicative (one thread unless stated):

| pyroid | Against | Speedup |
|---|---|---:|
| `trafilatura.extract`, default options (`compat="2.3.1"` / `"1.11.0"`) | Trafilatura 2.3.1 / 1.11.0 | 7.2× / 8.6× |
| `metrics`, ROUGE | rouge-score 0.1.2 | 59–65× |
| `metrics`, corpus BLEU / chrF | sacrebleu 2.6.0 | 11× / 19× |
| `json_repair.repair_json`, broken JSON | json_repair 0.64.9 | about 15× |
| `datasketch`, MinHash signatures, 1 / 8 threads | datasketch 2.0.0 | 8× / 21× |
| `jieba.lcut`, a batch, 1 / 8 threads | jieba 0.42.1 | 24× / 58× |
| `nltk.sent_tokenize` / `word_tokenize` | NLTK 3.10.4 | 60× / 31× |
| `filters`, FineWeb-2 settings, Chinese / Japanese | datatrove 0.10.1 | 44× / 7.8× |

`pyroid.json_repair` stays linear on the input families where json_repair is still quadratic, so
there the gap grows with the input. The [benchmarks page](https://ataiva.com/open-source/pyroid/docs/benchmarks/) has each
row's corpus, interpreter and source.

## Integrations

| Entry point | What it does |
|---|---|
| [`pyroid clean`](https://ataiva.com/open-source/pyroid/docs/guides/cli/) | the FineWeb-style chain as one command over Parquet or JSONL, or datatrove's FineWeb pipeline from WARC files |
| [Large datasets](https://ataiva.com/open-source/pyroid/docs/guides/large-datasets/) | `pyroid clean` over thousands of files: worker processes, `--shard I/N` across machines, `s3://`, `gs://` and `hf://` inputs, resumable runs, and MinHash dedup across shards with datatrove's files |
| [`pyroid.patch()`](https://ataiva.com/open-source/pyroid/docs/guides/patch/) | makes `import ftfy`, `fasttext`, `anyascii`, `datasketch`, `json_repair`, `trafilatura`, `nltk`, `warcio`, `nemo_curator`, `yaml`, `tabulate`, `dateutil`, `jmespath`, `packaging`, `sqlparse` and `langdetect` give pyroid's functions, in code you don't own, and patches `difflib` in place |
| [datatrove steps](https://ataiva.com/open-source/pyroid/docs/guides/datatrove/) | datatrove's pipeline steps with the same names and signatures, `Trafilatura` included |
| [NeMo Curator stages](https://ataiva.com/open-source/pyroid/docs/guides/nemo-curator/) | NeMo Curator 1.4.0's CPU text stages (`ScoreFilter`, the heuristic filters, the modifiers) with the same classes and arguments |
| [Hugging Face `datasets`](https://ataiva.com/open-source/pyroid/docs/guides/huggingface/) | batched callables for `Dataset.map` and `Dataset.filter` |

```python
import pyroid

pyroid.patch("yaml", "jmespath")  # from here on, yaml.safe_load and jmespath.search are pyroid's
```

The filters and dedup tokenize 4,049 of datatrove's 4,343 language codes natively, Chinese and
Vietnamese included. Native Japanese needs `pip install sudachidict-core`, and native Thai
`pip install pythainlp`. The rest go through datatrove's own tokenizers
([languages](https://ataiva.com/open-source/pyroid/docs/guides/languages/)).

## The 0.7.x releases

pyroid 1.0 is a rewrite, and its API is incompatible with 0.1 to 0.7. Those releases tried to make
Python faster with general-purpose helpers, most of which ran in Python. 1.0 replaces existing
libraries exactly, so it speeds up code that uses them, not Python in general.

0.7.x is still on PyPI (`pip install "pyroid<1"`), and its source is on the
[`legacy`](https://github.com/ao/pyroid/tree/legacy) branch.
[Migrating from 0.7](https://ataiva.com/open-source/pyroid/docs/migrating-from-0.7/) lists replacements.

## Development

The extension is built with [maturin](https://www.maturin.rs/):

```console
$ uv venv && source .venv/bin/activate
$ uv pip install maturin --group test
$ maturin develop --uv     # builds pyroid._pyroid into the venv (editable)
$ pytest python/tests
$ cargo test               # pure-Rust core (crates/pyroid-core)
```

Layout:

- `crates/pyroid-core`: pure Rust, no Python;
- `crates/pyroid-py`: the PyO3 bindings, built as `pyroid._pyroid`;
- `python/pyroid`: the typed Python package;
- `bench/`: the benchmark harness;
- `parity/`: differential tests against the incumbents;
- `docs/`: the documentation.

See [CONTRIBUTING.md](https://github.com/ao/pyroid/blob/main/CONTRIBUTING.md).

## License

pyroid's own code is MIT. The ported parts keep their licences, so the package's licence
expression is
`MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND PSF-2.0 AND Unicode-3.0 AND Zlib`:

- Apache-2.0: ported from ftfy, datatrove, rouge-score, NLTK (the Porter stemmer and the
  tokenizers), sacrebleu, Trafilatura, SudachiPy, warcio and langdetect (with its profiles);
- MIT: ported from fastText, spaCy, indic-nlp-library, urduhack, json_repair, datasketch, jieba
  (with its dictionary), libxml2 (the HTML parser), PyYAML, tabulate and jmespath;
- BSD-2-Clause: jusText (Trafilatura's paragraph classifier and its stoplists) and packaging
  (dual-licensed Apache-2.0 OR BSD-2-Clause, used under BSD-2-Clause);
- BSD-3-Clause: numpy's random generator (for C4 bad words), scipy's QUADPACK integration (for
  MinHashLSH's parameters), tldextract, lxml, python-dateutil (its later contributions are
  also Apache-2.0), sqlparse and the Mersenne Twister (MT19937);
- PSF-2.0: CPython's `ipaddress` (IPv6 parsing), float formatting, `difflib` and `random`;
- ISC: anyascii's transliteration data;
- Unicode-3.0: data from the Unicode Character Database;
- Zlib: zlib-rs, the Rust crate behind `pyroid.warc`'s gzip decoding.

See [LICENSE](https://github.com/ao/pyroid/blob/main/LICENSE),
[LICENSES/](https://github.com/ao/pyroid/tree/main/LICENSES) and
[NOTICE](https://github.com/ao/pyroid/blob/main/NOTICE), which lists the ported files.
[LICENSES/THIRD-PARTY-RUST.txt](https://github.com/ao/pyroid/blob/main/LICENSES/THIRD-PARTY-RUST.txt)
has the licences of the Rust crates the extension links.

