Classes
ContentEntry
dataclass
Unified representation of content from any source.
ContentEntry is source-agnostic - whether conte…
ContentEntry
dataclass Unified representation of content from any source.
ContentEntry is source-agnostic - whether content comes from local files, GitHub, Notion, or a REST API, it's represented the same way.
Attributes
| Name | Type | Description |
|---|---|---|
id |
str |
Unique identifier within the source (e.g., file path, doc ID) |
slug |
str |
URL-friendly slug for routing |
content |
str |
Raw content (typically markdown) |
frontmatter |
dict[str, Any] |
Parsed metadata dictionary |
source_type |
str |
Type of source ('local', 'github', 'notion', 'rest') |
source_name |
str |
Name of the configured source instance |
source_url |
str | None |
Original URL for attribution (optional) |
last_modified |
datetime | None |
Last modification time (for cache invalidation) |
checksum |
str | None |
Content hash (for change detection) |
etag |
str | None |
HTTP ETag (for conditional requests) |
cached_path |
Path | None |
Local cache file path (if cached) |
cached_at |
datetime | None |
When this entry was cached |
Methods 6
title
property
Get title from frontmatter or derive from slug.
title
property def title(self) -> str
Get title from frontmatter or derive from slug.
Returns
str
is_remote
property
Check if this entry came from a remote source.
is_remote
property def is_remote(self) -> bool
Check if this entry came from a remote source.
Returns
bool
is_cached
property
Check if this entry has been cached locally.
is_cached
property def is_cached(self) -> bool
Check if this entry has been cached locally.
Returns
bool
to_page_kwargs
Convert to kwargs for Page creation.
to_page_kwargs
def to_page_kwargs(self) -> dict[str, Any]
Convert to kwargs for Page creation.
Returns
Dictionary of kwargs suitable for Page.initdict[str, Any]
—
to_dict
Convert to dictionary for serialization.
to_dict
def to_dict(self) -> dict[str, Any]
Convert to dictionary for serialization.
Returns
Dictionary representation for JSON/cache storagedict[str, Any]
—
from_dict
classmethod
Create ContentEntry from dictionary.
from_dict
classmethod def from_dict(cls, data: dict[str, Any]) -> ContentEntry
Create ContentEntry from dictionary.
Parameters 1
data |
dict[str, Any] |
Dictionary from to_dict() or cache storage |
Returns
ContentEntry instanceContentEntry
—