Skip to content

oldas.prefixes

Provides constants for the prefixes used in various IDs in TheOldReader.

Prefix

Bases: StrEnum

TheOldReader ID prefixes.

ARTICLE class-attribute instance-attribute

ARTICLE = 'tag:google.com,2005:reader/item/'

An article.

FEED class-attribute instance-attribute

FEED = 'feed/'

A feed.

FOLDER class-attribute instance-attribute

FOLDER = 'user/-/label/'

A folder.

id_is_a

id_is_a(item_id: str, prefix: Prefix) -> bool

Does the ID look like it's of a particular type?

Parameters:

Name Type Description Default

item_id

str

The ID to check.

required

prefix

Prefix

The prefix to test against.

required

Returns:

Type Description
bool

True if the item_id has the provided prefix,

bool

False if not.

id_is_a_feed

id_is_a_feed(item_id: str) -> bool

Does the ID look like it's a feed?

Parameters:

Name Type Description Default

item_id

str

The ID to check.

required

Returns:

Type Description
bool

True if the ID looks like a feed, False if not.

id_is_a_folder

id_is_a_folder(item_id: str) -> bool

Does the ID look like it's a folder?

Parameters:

Name Type Description Default

item_id

str

The ID to check.

required

Returns:

Type Description
bool

True if the ID looks like a folder, False if not.

id_is_an_article

id_is_an_article(item_id: str) -> bool

Does the ID look like it's an article?

Parameters:

Name Type Description Default

item_id

str

The ID to check.

required

Returns:

Type Description
bool

True if the ID looks like an article, False if not.