Skip to content

Data Models Reference

Entry

The Entry class represents a single RSS entry/article.

Represents a Miniflux feed entry.

Source code in miniflux_tui/api/models.py
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
@dataclass
class Entry:
    """Represents a Miniflux feed entry."""

    id: int
    feed_id: int
    title: str
    url: str
    content: str
    feed: Feed
    status: str  # "read" or "unread"
    starred: bool
    published_at: datetime
    original_content: str | None = None
    enclosures: list[Enclosure] | None = None

    @classmethod
    def from_dict(cls, data: dict) -> "Entry":
        """Create an Entry from API response data."""
        # Parse enclosures if present
        enclosures = None
        if data.get("enclosures"):
            enclosures = [Enclosure.from_dict(enc) for enc in data["enclosures"]]

        return cls(
            id=data["id"],
            feed_id=data["feed_id"],
            title=data["title"],
            url=data["url"],
            content=data["content"],
            feed=Feed.from_dict(data["feed"]),
            status=data["status"],
            starred=data["starred"],
            published_at=datetime.fromisoformat(data["published_at"].replace("Z", "+00:00")),
            original_content=data.get("original_content"),
            enclosures=enclosures,
        )

    @property
    def is_read(self) -> bool:
        """Check if entry is marked as read."""
        return self.status == "read"

    @property
    def is_unread(self) -> bool:
        """Check if entry is marked as unread."""
        return self.status == "unread"

    @property
    def image_enclosures(self) -> list[Enclosure]:
        """Get all image enclosures for this entry."""
        if not self.enclosures:
            return []
        return [enc for enc in self.enclosures if enc.is_image]

image_enclosures property

Get all image enclosures for this entry.

is_read property

Check if entry is marked as read.

is_unread property

Check if entry is marked as unread.

from_dict(data) classmethod

Create an Entry from API response data.

Source code in miniflux_tui/api/models.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
@classmethod
def from_dict(cls, data: dict) -> "Entry":
    """Create an Entry from API response data."""
    # Parse enclosures if present
    enclosures = None
    if data.get("enclosures"):
        enclosures = [Enclosure.from_dict(enc) for enc in data["enclosures"]]

    return cls(
        id=data["id"],
        feed_id=data["feed_id"],
        title=data["title"],
        url=data["url"],
        content=data["content"],
        feed=Feed.from_dict(data["feed"]),
        status=data["status"],
        starred=data["starred"],
        published_at=datetime.fromisoformat(data["published_at"].replace("Z", "+00:00")),
        original_content=data.get("original_content"),
        enclosures=enclosures,
    )

Properties

  • id: Unique identifier for the entry
  • title: Entry title
  • content: Entry HTML content
  • published_at: Publication timestamp
  • is_read: Whether the entry has been read
  • starred: Whether the entry is starred/favorited
  • feed: The Feed this entry belongs to

Helper Methods

  • is_unread: Property that returns True if not read
  • status: Property that returns "read" or "unread"

Feed

The Feed class represents an RSS feed.

Represents a Miniflux feed.

Source code in miniflux_tui/api/models.py
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
@dataclass
class Feed:
    """Represents a Miniflux feed."""

    id: int
    title: str
    site_url: str
    feed_url: str
    category_id: int | None = None
    description: str = ""  # User-provided description or notes for the feed
    parsing_error_message: str = ""
    parsing_error_count: int = 0
    checked_at: str | None = None
    disabled: bool = False
    # Network settings
    username: str = ""
    password: str = ""
    user_agent: str = ""
    proxy_url: str = ""
    ignore_https_errors: bool = False
    # Rules & filtering (API uses blocklist_rules and keeplist_rules, not blocking_rules and keep_rules)
    scraper_rules: str = ""
    rewrite_rules: str = ""
    blocklist_rules: str = ""
    keeplist_rules: str = ""
    # Feed behavior options
    hide_globally: bool = False
    no_media_player: bool = False
    # Additional feed settings
    crawler: bool = False
    ignore_http_cache: bool = False
    fetch_via_proxy: bool = False
    check_interval: int | None = None

    @classmethod
    def from_dict(cls, data: dict) -> "Feed":
        """Create a Feed from API response data."""
        return cls(
            id=data["id"],
            title=data["title"],
            site_url=data["site_url"],
            feed_url=data["feed_url"],
            category_id=data.get("category_id"),
            description=data.get("description", ""),
            parsing_error_message=data.get("parsing_error_message", ""),
            parsing_error_count=data.get("parsing_error_count", 0),
            checked_at=data.get("checked_at"),
            disabled=data.get("disabled", False),
            username=data.get("username", ""),
            password=data.get("password", ""),
            user_agent=data.get("user_agent", ""),
            proxy_url=data.get("proxy_url", ""),
            ignore_https_errors=data.get("ignore_https_errors", False),
            scraper_rules=data.get("scraper_rules", ""),
            rewrite_rules=data.get("rewrite_rules", ""),
            blocklist_rules=data.get("blocklist_rules", ""),
            keeplist_rules=data.get("keeplist_rules", ""),
            hide_globally=data.get("hide_globally", False),
            no_media_player=data.get("no_media_player", False),
            crawler=data.get("crawler", False),
            ignore_http_cache=data.get("ignore_http_cache", False),
            fetch_via_proxy=data.get("fetch_via_proxy", False),
            check_interval=data.get("check_interval"),
        )

    @property
    def has_errors(self) -> bool:
        """Check if feed has parsing errors."""
        return bool(self.parsing_error_message or self.parsing_error_count > 0)

has_errors property

Check if feed has parsing errors.

from_dict(data) classmethod

Create a Feed from API response data.

Source code in miniflux_tui/api/models.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@classmethod
def from_dict(cls, data: dict) -> "Feed":
    """Create a Feed from API response data."""
    return cls(
        id=data["id"],
        title=data["title"],
        site_url=data["site_url"],
        feed_url=data["feed_url"],
        category_id=data.get("category_id"),
        description=data.get("description", ""),
        parsing_error_message=data.get("parsing_error_message", ""),
        parsing_error_count=data.get("parsing_error_count", 0),
        checked_at=data.get("checked_at"),
        disabled=data.get("disabled", False),
        username=data.get("username", ""),
        password=data.get("password", ""),
        user_agent=data.get("user_agent", ""),
        proxy_url=data.get("proxy_url", ""),
        ignore_https_errors=data.get("ignore_https_errors", False),
        scraper_rules=data.get("scraper_rules", ""),
        rewrite_rules=data.get("rewrite_rules", ""),
        blocklist_rules=data.get("blocklist_rules", ""),
        keeplist_rules=data.get("keeplist_rules", ""),
        hide_globally=data.get("hide_globally", False),
        no_media_player=data.get("no_media_player", False),
        crawler=data.get("crawler", False),
        ignore_http_cache=data.get("ignore_http_cache", False),
        fetch_via_proxy=data.get("fetch_via_proxy", False),
        check_interval=data.get("check_interval"),
    )

Feed Properties

  • id: Unique feed identifier
  • title: Feed title
  • url: Feed URL
  • unread_count: Number of unread entries in this feed

EntryListItem

Internal widget class for rendering entries in the list.

FeedHeaderItem

Internal widget class for rendering feed group headers in grouped mode.

Usage Example

from miniflux_tui.api.models import Entry, Feed

# Create a feed
feed = Feed(id=1, title="My Blog", url="https://example.com/feed")

# Create an entry
entry = Entry(
    id=123,
    title="My Article",
    content="<p>Article content</p>",
    published_at=1699564800,
    is_read=False,
    starred=False,
    feed=feed
)

# Check properties
print(f"Entry: {entry.title}")
print(f"Feed: {entry.feed.title}")
print(f"Status: {entry.status}")
print(f"Is unread: {entry.is_unread}")