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_hashfor 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:titlelinkdescriptionsummarypub_date(ISO-like UTC string, when available)authorimagecategories
request_hash: SHA-256 hash of normalized parsed payload.error: present when parsing fails (itemswill be empty in that case).
Support & Connect
- ⭐ Star the repo if you found it useful
- ☕ Support me: Say thanks by buying me a coffee! https://buymeacoffee.com/juanmcristobal
- 💼 Open to work: https://www.linkedin.com/in/jmcristobal/
Author
- Juan Manuel Cristóbal Moreno (juanmcristobal@gmail.com)
See AUTHORS.md for contributors.
History
0.3.1 (2026-06-30)
- Added a
feedtrailcommand-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.
Release files for feedtrail 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| feedtrail-0.3.1.tar.gz | 17.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| feedtrail-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.5 kB
Release files / feedtrail-0.3.1.tar.gz
| Download URL | feedtrail-0.3.1.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fde7150bb4854316a80b7de34af83463c8e4665b6e9ebdf7147d1ac065fe1898
|
|
BLAKE2b-256 checksum How to use checksums |
7419ab0329b6f37cf669e99dca72acf3b62b778f52a3724ccf2680c48695d7a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 30, 2026.
Transparency logRelease files / feedtrail-0.3.1-py3-none-any.whl
| Download URL | feedtrail-0.3.1-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
495e409ce57437125b2a2c859a1ae1ac121c2f580760e5ce7d81cdd02a08bd89
|
|
BLAKE2b-256 checksum How to use checksums |
33c6ca4b01332f95004ca012dad5b285a59c1e74c6fe0287411cc2aa505a3e6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 30, 2026.
Transparency log