Skip to main content

Feed Tracking and Retrieval Abstraction Interface Layer

Project description

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.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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feedtrail-0.3.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

feedtrail-0.3.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file feedtrail-0.3.1.tar.gz.

File metadata

  • Download URL: feedtrail-0.3.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for feedtrail-0.3.1.tar.gz
Algorithm Hash digest
SHA256 fde7150bb4854316a80b7de34af83463c8e4665b6e9ebdf7147d1ac065fe1898
MD5 4f036bc8d618e6346464fe8cf9c979ca
BLAKE2b-256 7419ab0329b6f37cf669e99dca72acf3b62b778f52a3724ccf2680c48695d7a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedtrail-0.3.1.tar.gz:

Publisher: release.yml on juanmcristobal/feedtrail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feedtrail-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: feedtrail-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for feedtrail-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 495e409ce57437125b2a2c859a1ae1ac121c2f580760e5ce7d81cdd02a08bd89
MD5 74bc7f38c6baddec344008bf7ae2da46
BLAKE2b-256 33c6ca4b01332f95004ca012dad5b285a59c1e74c6fe0287411cc2aa505a3e6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for feedtrail-0.3.1-py3-none-any.whl:

Publisher: release.yml on juanmcristobal/feedtrail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page