Skip to main content

feedtrail banner

FeedTrail

Feed Tracking and Retrieval Abstraction Interface Layer.

feedtrail provides a resilient RSS/Atom parser focused on production-style feeds where XML can be noisy, partially malformed, or inconsistent across publishers.

Repository: https://github.com/juanmcristobal/feedtrail

What It Does

  • Parses RSS and Atom feeds with namespace support.
  • Normalizes and cleans feed/item text content.
  • Converts heterogeneous date formats to UTC ISO strings.
  • Extracts structured metadata: title, link, description, summary, author, categories, and primary image.
  • Computes a deterministic request_hash for parsed payload integrity checks.
  • Handles malformed XML defensively (entity sanitization, escaped CDATA recovery, trailing content trimming).

Installation

pip install feedtrail

Command Line

feedtrail reads XML from standard input and prints normalized JSON to standard output. The example below uses crawlsmith to fetch the feed content.

crawlsmith fetch https://example.com/feed.xml | jq -r ".content" | feedtrail

If you need relative URLs resolved, pass a base URL:

feedtrail --base-url https://example.com < feed.xml

Quick Start

from feedtrail.feed_parser import FeedParser

xml_content = """<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Example Feed</title>
    <link>https://example.com</link>
    <description>Demo</description>
    <item>
      <title>Hello</title>
      <link>/hello</link>
      <pubDate>Wed, 20 Mar 2024 09:00:00 GMT</pubDate>
      <description><![CDATA[Post body]]></description>
    </item>
  </channel>
</rss>"""

parser = FeedParser()
result = parser.parse(xml_content, base_url="https://example.com")

print(result["headers"]["title"])
print(result["items"][0]["link"])

Output Contract

FeedParser.parse(...) returns a dictionary with:

  • headers: feed-level metadata (title, link, description, updated, language, generator, parent_link, self_link).
  • items: list of normalized entries, each including:
    • title
    • link
    • description
    • summary
    • pub_date (ISO-like UTC string, when available)
    • author
    • image
    • categories
  • request_hash: SHA-256 hash of normalized parsed payload.
  • error: present when parsing fails (items will be empty in that case).

Support & Connect

Author

See AUTHORS.md for contributors.

History

0.3.2 (2026-10-27)

  • Fixed quadratic regex backtracking (ReDoS) in image and RSS author extraction that let a malicious feed stall parsing.

0.3.1 (2026-06-30)

  • Added a feedtrail command-line entry point for parsing XML from standard input.
  • Added support for parsing byte-string XML content.
  • Documented command-line usage with a generic feed URL and linked crawlsmith.

0.1.0 (2026-03-25)

  • First release.

Metadata

Release files for feedtrail 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feedtrail 0.3.2
File Size Uploaded Provenance Actions
feedtrail-0.3.2.tar.gz 18.0 kB With provenance Details for feedtrail-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for feedtrail 0.3.2
File Interpreter ABI Platform Actions
feedtrail-0.3.2-py3-none-any.whl Python 3 none any Details for feedtrail-0.3.2-py3-none-any.whl

Total release size: 31.1 kB

Release files / feedtrail-0.3.2.tar.gz

Download URL feedtrail-0.3.2.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dd054a4c45305c04a84e381ef3fb7d18f67565084bc24ac24ba1d8bab2f17acd
BLAKE2b-256 checksum
How to use checksums
513db2e64d594e623febf22071879940e294acee527b2d943875728a6a53889a
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 Oct 27, 2026.

Transparency log

Release files / feedtrail-0.3.2-py3-none-any.whl

Download URL feedtrail-0.3.2-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e6a99822810e99e0a2a34d225954e2596cdc50c876af128b5b642abf15b429e
BLAKE2b-256 checksum
How to use checksums
ea08edba5b7efcb5305002fc720c917aff10d7b05f4313550b97dc5cd722e16f
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 Oct 27, 2026.

Transparency log

Security for feedtrail 0.3.2

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for feedtrail-0.3.2.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 27, 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