curated_feed.opml

OPML subscription-list parsing.

Feedly (and most readers) export feeds nested inside folder outlines, so the walk is recursive and records the folder path for each feed. Phase 0 does not use the folder, but later phases weight and quota by source group.

Attributes

Exceptions

OpmlError

Raised when the OPML file is missing or cannot be parsed.

Classes

Feed

A single subscription from the OPML file.

Functions

parse_opml(→ list[Feed])

Parse an OPML export into feeds, in document order.

Module Contents

curated_feed.opml.FOLDER_SEPARATOR = '/'
exception curated_feed.opml.OpmlError[source]

Bases: Exception

Raised when the OPML file is missing or cannot be parsed.

class curated_feed.opml.Feed[source]

A single subscription from the OPML file.

title: str
xml_url: str
folder: str | None = None
curated_feed.opml.parse_opml(path: pathlib.Path | str) → list[Feed][source]

Parse an OPML export into feeds, in document order.

Outlines without an xmlUrl are treated as folders and recursed into. Feeds appearing more than once (the same xmlUrl filed under two folders) are kept once, at their first occurrence.