Skip to content

oldas.unread

Provides a class for getting unread information.

Count dataclass

Count(
    id: str,
    unread: int,
    newest_timestamp: datetime,
    prefix: str,
)

Unread count information class.

id instance-attribute

id: str

The ID of the item that has an unread count.

name property

name: str

The name of the count.

newest_timestamp instance-attribute

newest_timestamp: datetime

The timestamp of the newest item.

prefix instance-attribute

prefix: str

The prefix related to this type of count.

unread instance-attribute

unread: int

The unread count.

from_json classmethod

from_json(data: RawData, prefix: str) -> Count

Load the count from JSON data.

Parameters:

Name Type Description Default

data

RawData

The data to load the count from.

required

prefix

str

The prefix to associate with this type of count.

required

Returns:

Type Description
Count

The count information.

Counts

Counts(data: Iterable[OldData] | None = None)

Bases: OldList[Count]

Holds a collection of counts.

Unread dataclass

Unread(total: int, folders: Counts, feeds: Counts)

Class that loads and holds unread counts.

feeds instance-attribute

feeds: Counts

The unread count for each feed.

folders instance-attribute

folders: Counts

The unread counts for each folder.

total instance-attribute

total: int

The total unread count.

load async classmethod

Load the unread counts.

Parameters:

Name Type Description Default

session

Session

The API session object.

required

Returns:

Type Description
Unread

The unread counts.