Python binding of trafilatura-rs: web page main text, comments and metadata extraction at Rust speed, trafilatura-compatible syntax.
An EDamLabs binding: a Python binding of a third-party engine that keeps its upstream's syntax and follows its releases (EDamLabs families).
Install
pip install rtrafilatura # or: uv add rtrafilatura
Usage
import rtrafilatura as trafilatura # drop-in syntax
downloaded = trafilatura.fetch_url("https://example.org/article")
trafilatura.extract(downloaded, output_format="markdown", with_metadata=True)
trafilatura.extract(html_string) # 'txt' by default
trafilatura.bare_extraction(html_string) # Document with .text, .body, .comments…
trafilatura.extract_metadata(html_string) # title, author, date, sitename…
trafilatura.extract("https://example.org/article", input_format="auto") # extension: fetch, then extract
Benchmark
Benchmark — pytest-benchmark medians against Python trafilatura 2.3.1: on the two real pages (PEP 8, Wikipedia), 1.2–1.5× faster plain-text extraction, 1.6–2.1× with XML and metadata, 2.7–4.4× on metadata alone. Extraction on small synthetic pages, under a millisecond, weighs the Python-side tree conversion more: 0.6–2.9×. html2txt and baseline run the same vendored code on both sides and measure the noise: 0.9–1.2× (full matrix and method).
Agreement with trafilatura
Agreement with trafilatura — on the synthetic test pages, 64 of 84 format cases are byte-identical and the other 20 are declared differences (tags, TEI version). On the eight-page corpus, real pages included, word-token agreement is 99.5 % (txt) and 99.6 % (markdown); the real pages differ by the engine's content selection (method, map).
| Outputs | Every output format, and what each carries |
| Benchmark | Timings against Python trafilatura, per method and document |
| API | extract, bare_extraction, fetch_url, extract_metadata, … |
| Errors | What can fail, and how to catch it |
| Compatibility | Drop-in map from trafilatura, and the known gaps |
| Self-maintenance | How the binding follows trafilatura-rs on its own |
Extraction quality, heuristics and performance belong to trafilatura-rs: extraction issues go upstream, Python API issues here.
License
MIT, binding © EDamLabs; the engine is Apache-2.0. Wheels statically link the engine and its dependencies; their licenses ship in THIRD_PARTY_LICENSES.md.
Metadata
Release files for rtrafilatura 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rtrafilatura-0.2.0.tar.gz | 122.7 kB | With provenance | Details for rtrafilatura-0.2.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| rtrafilatura-0.2.0-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details for rtrafilatura-0.2.0-cp312-abi3-win_amd64.whl |
| rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details for rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl |
| rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ ARM64 | Details for rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_aarch64.whl |
| rtrafilatura-0.2.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details for rtrafilatura-0.2.0-cp312-abi3-macosx_11_0_arm64.whl |
| rtrafilatura-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl | CPython 3.12 | abi3 | macOS 10.12+ x86-64 | Details for rtrafilatura-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl |
Total release size: 13.7 MB
Release files / rtrafilatura-0.2.0.tar.gz
| Download URL | rtrafilatura-0.2.0.tar.gz |
|---|---|
| Size | 122.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d49078be864ac44b04783c310467bae63811492884c8cd455610e22b6270d89
|
|
BLAKE2b-256 checksum How to use checksums |
d278671120c08d6f7e2a86389589f8fe239cbaccbbced14b7710226ed8ab0882
|
| 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 Oct 28, 2026.
Transparency logRelease files / rtrafilatura-0.2.0-cp312-abi3-win_amd64.whl
| Download URL | rtrafilatura-0.2.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
efe4bd8d8e4b587eb18ae9307164d9cc147c99daedbf11acb87e20d46d5450c6
|
|
BLAKE2b-256 checksum How to use checksums |
5e426052610d932aa075a47bcb8f97b37f7bb4eb443191b6a88787b8c7dd8795
|
| 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 Oct 28, 2026.
Transparency logRelease files / rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8b07cd48575faf11d622cdb249f28ee7bbcfe4bc2ab94795733069fbeebf2556
|
|
BLAKE2b-256 checksum How to use checksums |
5caf5a7e257dc0ad671abae16d74b9663e369dc3f7a72782cfc8de3185d4d9c0
|
| 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 Oct 28, 2026.
Transparency logRelease files / rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | rtrafilatura-0.2.0-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
19edf87b8f0165e7d8c5e45298962a17572d1ce2531e32dd9c871545b813b3df
|
|
BLAKE2b-256 checksum How to use checksums |
81a9e903289e3350e3f432fd26078a75c834d3ca0e411241cecd6d0004bfeb75
|
| 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 Oct 28, 2026.
Transparency logRelease files / rtrafilatura-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | rtrafilatura-0.2.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4fb40bbb394d8b61dd0b7d90131cbb34efad6a1c1bf55aaf0ee58b4b322f372f
|
|
BLAKE2b-256 checksum How to use checksums |
a846fe475a486606ee8ff29c22156684bd8f47efbf78ee8ce06ab88ccfeb3352
|
| 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 Oct 28, 2026.
Transparency logRelease files / rtrafilatura-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | rtrafilatura-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
259d9e53ebd994dd09eb42542e5d3db582c53b6a7690c91950610d158751159f
|
|
BLAKE2b-256 checksum How to use checksums |
e42e10c4c4575b51dc21af367bec70a2fbc0fbfa70f646ce052ab3319ec03ff1
|
| 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 Oct 28, 2026.
Transparency logSecurity for rtrafilatura 0.2.0
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.
Attestation for rtrafilatura-0.2.0.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 Oct 28, 2026.
Transparency logA 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.