pypi / trafilatura
trafilatura
What changed in trafilatura 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
5 breaking4 deprecations6 new APIs and options3 performance10 behavior and defaults43 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittrafilatura 263 changes
Breaking changes 4
bare_extraction() now returns a Document instance by default.
The decode argument was removed; use fetch_response instead.
The deprecated graphical user interface was removed.
Configure max_tree_size in settings.cfg instead of passing it as an extraction parameter.
Deprecations 4
The release adds more deprecation warnings.
The as_dict argument is deprecated; call .as_dict() on the returned value instead.
The no_fallback argument is deprecated; use fast instead.
Python 3.6 and 3.7 are deprecated.
New APIs and options 2
Adds the extract_with_metadata method.
Extraction adds support for meta name image.
Performance 2
Deduplication is simpler and faster.
XPath performance is faster using XSLT extensions.
Behavior and default changes 9
Boilerplate pruning is more targeted to reduce over-extraction.
Subelem processing was further improved, mostly for math, code, and Markdown.
The text recovery and extraction sequence was revamped for better overall recall and forum extraction.
Title extraction was improved.
Spacing is improved in item, cell, and code blocks.
The detector supports all Justext languages known to it.
The CLI adds exit code 126 for a high error ratio.
The CLI prints URLs early for feeds and sitemaps when --list is used.
Table markdown output was refined.
Fixes and other changes 42
Brackets inside inline code in link text are no longer escaped.
The output contains fewer duplicated segments.
Image paragraphs are no longer repeated in the output.
Text after inline code is no longer repeated in the output.
Document handling was simplified and made more correct.
Downloads and decompression were overhauled, with more robust handling of relative URLs and zstd frames.
Link discovery improved for sitemap namespaces, Atom links, and JSON feeds.
Markdown output improved for spacing, bold spans, CommonMark escaping, and LaTeX math.
Metadata handling improved for word boundaries, JSON-LD types, OpenGraph, license links, list values, canonical URLs, and TXT/Markdown headers.
Fallbacks now preserve requested images.
Scoped caches are now accepted.
Text extraction improved for forms, link farms, inline code and links, infinite scroll, boilerplate widgets, nested lists, and text after blocks.
Image extensions are matched case-insensitively.
Metadata values are quoted so the Markdown header remains valid YAML.
Angle brackets in Markdown link destinations are escaped.
A space after inline formatting is preserved in Markdown list items.
List items whose only content is a link are retained.
Superscript and subscript boundaries are preserved in Markdown output.
Processing for nested elements was improved.
Text inside nobr tags is retained.
Output formatting bugs were addressed.
Text in sub-elements is handled better.
Table processing is more accurate.
Question headers in Yoast FAQ blocks are retained.
None values in code blocks are replaced.
Fixes eager matching by the doctype regular expression.
Code is changed to handle potential empty strings.
The fencedframe element is cleaned during extraction.
The tokenizer now strips the Ideographic Full Stop.
Images are preserved when links are included.
Refines image source URL handling and fixes table extraction bugs.
Links in tables are preserved when --links is enabled.
The no_fallback setting is propagated to the fast argument.
Fixes an AttributeError that node pruning could raise in certain cases.
Code in pre-tags is detected using indicators, and code formatting issues are fixed.
Table extraction is made more robust.
Mapping for conversion to HTML is more robust.
Extraction of images in text nodes was fixed.
options.source is set before an error is raised for an empty document tree.
Encoding handling for options.source is more robust.
CLI downloads now use all information in the settings file.
URL extraction is more robust.
trafilatura 18 changes
Breaking changes 1
Support for Python 3.5 is dropped.
New APIs and options 4
The graphical user interface is integrated into the main package.
JSON web feeds are supported.
An optional module provides language identification with py3langid.
An optional module enables downloads with pycurl.
Performance 1
Downloads are faster following a review of backoff and compressed data.
Behavior and default changes 1
HTML backup files are compressed, and .gz files can be opened seamlessly.
Fixes and other changes 1
Fixed handling of arrays with a single or multiple entries.