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

    @classmethod
    def from_dict(cls, data: dict) -> "Entry":
        """Create an Entry from API response data."""
        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"),
        )

    @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"

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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@classmethod
def from_dict(cls, data: dict) -> "Entry":
    """Create an Entry from API response data."""
    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"),
    )

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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@dataclass
class Feed:
    """Represents a Miniflux feed."""

    id: int
    title: str
    site_url: str
    feed_url: str
    category_id: int | None = None
    parsing_error_message: str = ""
    parsing_error_count: int = 0
    checked_at: str | None = None
    disabled: bool = False

    @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"),
            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),
        )

    @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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@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"),
        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),
    )

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}")