GhostPost

Documentation for eth_defi.vault_report.ghost.GhostPost Python class.

class GhostPost

Bases: object

Subset of Ghost post fields we use.

Parsed from both the Content API and the Admin API, which return the same post object shape; see the Admin API posts reference.

Attributes summary

id

Ghost object id

title

Post title

slug

URL slug

status

draft, scheduled or published

html

Post body, when requested with formats=html

published_at

Publication time, naive UTC

updated_at

Last update timestamp as returned by Ghost, kept as the raw string: Ghost requires it back unchanged on an update to detect a concurrent edit, and DraftRecord compares it by string equality

custom_excerpt

Post excerpt

feature_image

Feature image URL

Methods summary

__init__(id, title, slug, status, html, ...)

from_api(data)

Parse a post from a Ghost API response.

id: str

Ghost object id

title: str

Post title

slug: str

URL slug

status: str

draft, scheduled or published

html: Optional[str]

Post body, when requested with formats=html

published_at: Optional[datetime.datetime]

Publication time, naive UTC

updated_at: Optional[str]

Last update timestamp as returned by Ghost, kept as the raw string: Ghost requires it back unchanged on an update to detect a concurrent edit, and DraftRecord compares it by string equality

custom_excerpt: Optional[str]

Post excerpt

feature_image: Optional[str]

Feature image URL

static from_api(data)

Parse a post from a Ghost API response.

Parameters

data (dict) – One entry of the posts list.

Returns

Parsed post.

Return type

eth_defi.vault_report.ghost.GhostPost

__init__(id, title, slug, status, html, published_at, updated_at, custom_excerpt=None, feature_image=None)
Parameters
Return type

None