oldas.articles
Provides a class for getting article data.
Direction
module-attribute
Direction = Literal['ltr', 'rtl']
Possible values for the summary direction.
Article
Bases: NamedTuple
Holds details about an article.
author
instance-attribute
author
The author of the article.
categories
instance-attribute
categories
The list of categories associated with this article.
id
instance-attribute
id
The ID of the article.
is_fresh
property
is_fresh
Is the article considered fresh?
is_read
property
is_read
Has this article been read?
is_stale
property
is_stale
Is the article considered stale?
is_unread
property
is_unread
Is the article still unread?
is_updated
property
is_updated
Does the article look like it's been updated?
origin
instance-attribute
origin
The origin of the article.
published
instance-attribute
published
The time when the article was published.
raw
class-attribute
instance-attribute
raw = None
The raw data from the API.
summary
instance-attribute
summary
The summary of the article.
title
instance-attribute
title
The title of the article.
updated
instance-attribute
updated
The time when the article was updated.
clean_categories
staticmethod
clean_categories(categories)
from_json
classmethod
from_json(data)
Load the article from JSON data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
RawData
|
The data to load the article from. |
required |
Returns:
| Type | Description |
|---|---|
Article
|
The article. |
mark_read
async
mark_read(session)
Articles
Articles(data=None)
Bases: OldList[Article]
Loads and holds a full list of articles.
stream
async
classmethod
Load articles from a given stream.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Session
|
The API session object. |
required |
|
str | Subscription | Folder
|
The stream identifier to load from. |
''
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[Article]
|
The articles. |
stream_new_since
async
classmethod
Stream all articles newer than a given time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Session
|
The API session object. |
required |
|
datetime
|
Time from which to load articles. |
required |
|
str | Subscription | Folder
|
The stream identifier to stream from. |
''
|
Yields:
| Type | Description |
|---|---|
AsyncIterator[Article]
|
Articles. |
Origin
Bases: NamedTuple
The origin details for an article.
html_url
instance-attribute
html_url
The URL of the HTML of the origin of the article.
raw
class-attribute
instance-attribute
raw = None
The raw data from the API.
stream_id
instance-attribute
stream_id
The stream ID for the article's origin.
title
instance-attribute
title
The title of the origin of the article.
Summary
Bases: NamedTuple
The summary details for an article.
content
instance-attribute
content
The content of the summary.
direction
instance-attribute
direction
The direction for the text in the summary.
raw
class-attribute
instance-attribute
raw = None
The raw data from the API.