Trafilatura, go-trafilatura, and Trafilatura Core
Trafilatura is a Python toolkit; go-trafilatura is its Go port; Trafilatura Core is an offline engine with TypeScript and native Python implementations. Compare their inputs, outputs, and runtime boundaries before selecting one. A port reimplements behavior in another language; a fork continues and changes an existing codebase.
Trafilatura Core is an open-source extraction engine based on Trafilatura, implemented in TypeScript and Python. Its TypeScript engine directly ports Python Trafilatura v2.2.0's fast=True path, using go-trafilatura only as a DOM translation aid. Its native Python engine translates that port, with documented language differences.12
The family at a glance
Python Trafilatura is the source of go-trafilatura and Trafilatura Core's TypeScript extraction engine. Core ports Python v2.2.0's fast=True path; the dashed Go relationship is only a DOM translation aid.31
Project status was checked on September 29, 2026.
| Project | Language / runtime | Scope | Fetching / crawling | Main content output | Distinguishing behavior | License | Status |
|---|---|---|---|---|---|---|---|
| Trafilatura | Python 3.10+ | Full toolkit and CLI | Downloads, URL discovery, crawling | TXT, Markdown, CSV, JSON, HTML, XML, TEI | Canonical extraction and metadata behavior | Apache-2.0 from v1.8.0; earlier GPLv3+ | Production/Stable; v2.2.0456 |
| go-trafilatura | Go 1.26.0+ | Package and network-capable CLI | URL, batch, feed, sitemap | HTML by default; text and JSON options | Python 2.2.0 core; bundled readability-lxml fallback | Apache-2.0 | v2.2.6; /v2 module path378 |
| Trafilatura Core | TypeScript; native Python | Offline extraction engine | None | Cleaned HTML plus metadata | TypeScript port of Trafilatura v2.2.0's fast=True path; native Python translation | Apache-2.0 | npm and PyPI 0.8.212 |
Trafilatura: the Python original
Adrien Barbaresi created the canonical Trafilatura project during PhD work in linguistics and natural language processing, initially to build research text databases at the Berlin-Brandenburg Academy of Sciences. The 2021 ACL system-demonstration paper describes the same corpus-building context.910
The current project is broader than an extraction function. It discovers and crawls URLs, downloads pages, accepts saved HTML, extracts main text, comments, and metadata, preserves document structure, and serializes several text and markup formats.4 Version 2.2.0 was released on July 31, 2026. Current packaging labels the project Production/Stable and requires Python 3.10 or newer.6
Trafilatura's present license is Apache-2.0. Releases before v1.8.0 used GPLv3+; that historical boundary matters when auditing copied or vendored older code.5
go-trafilatura: compatibility with substitutions
go-trafilatura ports Trafilatura into Go and deliberately mirrors much of the Python project's structure. Version v2.2.6 follows Python Trafilatura 2.2.0's non-fallback extraction path. Its goal is compatible extraction, not byte-for-byte identity: Go's HTML parser and date dependencies, automatic language annotation, and deliberate cleanup differences can change the result.3
The package extracts supplied HTML. Its CLI adds downloading plus file, URL-list, feed, and sitemap modes; HTML is the default output, with text and JSON options.7 The current module path is github.com/markusmobius/go-trafilatura/v2, requiring Go 1.26.0 or newer; its preferred development toolchain is Go 1.27.1.8
Fallback configuration matters. The library disables external fallback by default; EnableFallback: true permits only its bundled native readability-lxml implementation. The CLI enables that fallback unless --no-fallback is set. Go v2.2.6 does not use Mozilla Readability, DOM Distiller, supplied candidates, or Python's jusText recovery in this path. Native recall and baseline recovery remain available when fallback is disabled.3
Trafilatura Core: a bounded offline engine
Trafilatura Core provides TypeScript and native Python implementations. The TypeScript package requires no native module. Its extraction core is ported from Python Trafilatura v2.2.0's fast=True path, while its metadata reader ports the original Python reader. go-trafilatura served only as a DOM translation aid where Python's lxml idioms needed a DOM equivalent. The native Python implementation translates the TypeScript engine.1
Trafilatura Core adds an HTML output stage. It ships no machine-learning model, no page-type taxonomy, and no classification output; the only page type it reports is the one a page declares in its own OpenGraph or JSON-LD metadata.2
The engine accepts HTML plus optional URL context and returns one cleaned-HTML string with metadata. It does not fetch or render pages, and it does not itself convert content to Markdown, plain text, or JSON. A JSON CLI envelope does not change that content-output boundary. Both the npm and native Python packages are at 0.8.2; Python provides library code rather than a product CLI, and its documented capability differences do not imply complete TypeScript parity.2
One benchmark, one dataset
The archived ScrapingHub article-extraction benchmark is the narrow comparison retained here. This vendor-authored test uses 181 stored HTML pages and article-body ground truth. Its evaluator counts overlapping four-token shingles, macro-averages per-page precision and recall, and computes F1 as the harmonic mean of those two averages. The ± values are standard deviations from 1,000 bootstrap page resamples, not confidence intervals.11
Results below are historical third-party implementation results, verified against archive commit 4a3bc979 on September 29, 2026. Python ran with comments disabled; Go ran with fallback enabled. These settings and revisions matter more than the current project names.11
| Implementation tested | Tested revision | Precision | Recall | F1 |
|---|---|---|---|---|
| Trafilatura | 2.0.0 | 0.938 ± 0.009 | 0.978 ± 0.006 | 0.958 ± 0.006 |
| go-trafilatura | ae7ea06 | 0.940 ± 0.009 | 0.980 ± 0.006 | 0.960 ± 0.007 |
I would not choose a library on this gap alone. The set covers article-body extraction, not metadata, crawling, other page types, or current releases. Trafilatura Core is not a row in this benchmark; neither upstream score transfers to Core, and the table says nothing about today's Python 2.2.0 or Go v2.2.6 results.
Choosing by boundary
- Python Trafilatura provides discovery, downloading, extraction, metadata, and several serialized formats in one toolkit.
- go-trafilatura provides a Go package and network-capable CLI, with the fallback and formatting differences documented above.
- Trafilatura Core serves Node and Python applications that supply HTML and need cleaned HTML.
Citations
-
Trafilatura Core: compact third-party notices and ported source header. Retrieved September 29, 2026. ↩ ↩2 ↩3 ↩4
-
Trafilatura Core: README scope, native Python library and differences, npm 0.8.2 package, PyPI 0.8.2 package, and GitHub Releases. Retrieved September 29, 2026. ↩ ↩2 ↩3 ↩4
-
go-trafilatura: v2.2.6 extraction choices, upstream compatibility boundaries, and bundled fallback implementation. Retrieved September 29, 2026. ↩ ↩2 ↩3 ↩4
-
Trafilatura: Python usage and output documentation. Version 2.2.0 documentation. Retrieved September 29, 2026. ↩ ↩2
-
Trafilatura: current and historical license statement and v1.8.0 release. Retrieved September 29, 2026. ↩ ↩2
-
Trafilatura: v2.2.0 release and current package metadata. Retrieved September 29, 2026. ↩ ↩2
-
go-trafilatura: Library inputs and outputs and CLI modes. Retrieved September 29, 2026. ↩ ↩2
-
go-trafilatura: v2.2.6 release, versioned Go module, module and toolchain manifest, and Apache-2.0 license. Retrieved September 29, 2026. ↩ ↩2
-
Adrien Barbaresi: Trafilatura repository project history. Retrieved September 29, 2026. ↩
-
Adrien Barbaresi: Trafilatura: A Web Scraping Library and Command-Line Tool for Text Discovery and Extraction. ACL-IJCNLP System Demonstrations, 2021. ↩
-
ScrapingHub: Vendor-authored technical report, archived results and data provenance, shingle scoring, macro-averages, and bootstrap standard deviations, Python configuration, and Go configuration. Retrieved September 29, 2026. ↩ ↩2
Updated: October 3, 2026