Classes
LinkType
Semantic relationship types between pages.
Links carry meaning beyond simple connectivity. The typ…
LinkType
Semantic relationship types between pages.
Links carry meaning beyond simple connectivity. The type indicates the editorial intent and discoverability value of the relationship.
EnumAttributes
| Name | Type | Description |
|---|---|---|
EXPLICIT |
— | Human-authored markdown links text in content |
MENU |
— | Navigation menu item (deliberate prominence) |
TAXONOMY |
— | Shared tags/categories (topic clustering) |
RELATED |
— | Algorithm-computed related posts (automated) |
TOPICAL |
— | Section hierarchy parent → child (topical context) |
SEQUENTIAL |
— | Next/prev navigation within section (reading order) |
LinkMetrics
dataclass
Detailed link breakdown for a page.
Tracks the count of each link type pointing to a page,
enablin…
LinkMetrics
dataclass Detailed link breakdown for a page.
Tracks the count of each link type pointing to a page, enabling weighted connectivity scoring.
Attributes
| Name | Type | Description |
|---|---|---|
explicit |
int |
Count of explicit markdown links |
menu |
int |
Count of menu item references |
taxonomy |
int |
Count of shared taxonomy links |
related |
int |
Count of related post links |
topical |
int |
Count of section hierarchy links (parent → child) |
sequential |
int |
Count of next/prev navigation links |
Methods 6
connectivity_score
Calculate weighted connectivity score.
connectivity_score
def connectivity_score(self, weights: dict[LinkType, float] | None = None) -> float
Calculate weighted connectivity score.
Parameters 1
weights |
dict[LinkType, float] | None |
Optional custom weights. Defaults to DEFAULT_WEIGHTS. |
Returns
Weighted sum of all link counts. Higher = better connected.float
—
total_links
Total number of incoming links (unweighted).
total_links
def total_links(self) -> int
Total number of incoming links (unweighted).
Returns
int
has_human_links
True if page has any human-authored links (explicit or menu).
has_human_links
def has_human_links(self) -> bool
True if page has any human-authored links (explicit or menu).
Returns
bool
has_structural_links
True if page has structural links (section/nav).
has_structural_links
def has_structural_links(self) -> bool
True if page has structural links (section/nav).
Returns
bool
has_any_links
True if page has any incoming links.
has_any_links
def has_any_links(self) -> bool
True if page has any incoming links.
Returns
bool
to_dict
Convert to dictionary for serialization.
to_dict
def to_dict(self) -> dict[str, int]
Convert to dictionary for serialization.
Returns
dict[str, int]
ConnectivityLevel
Connectivity classification based on weighted score thresholds.
Replaces binary orphan/not-orphan …
ConnectivityLevel
Connectivity classification based on weighted score thresholds.
Replaces binary orphan/not-orphan with nuanced levels that reveal opportunities for improvement.
Levels (from best to worst):
- WELL_CONNECTED: Score >= 2.0 (no action needed)
- ADEQUATELY_LINKED: Score 1.0-2.0 (could improve)
- LIGHTLY_LINKED: Score 0.25-1.0 (should improve)
- ISOLATED: Score < 0.25 (needs attention)
EnumMethods 4
emoji
property
Get emoji indicator for this level.
emoji
property def emoji(self) -> str
Get emoji indicator for this level.
Returns
str
label
property
Get human-readable label for this level.
label
property def label(self) -> str
Get human-readable label for this level.
Returns
str
description
property
Get description of what action is needed for this level.
description
property def description(self) -> str
Get description of what action is needed for this level.
Returns
str
from_score
classmethod
Classify a page based on its connectivity score.
from_score
classmethod def from_score(cls, score: float, thresholds: dict[str, float] | None = None) -> ConnectivityLevel
Classify a page based on its connectivity score.
Parameters 2
score |
float |
Weighted connectivity score from LinkMetrics |
thresholds |
dict[str, float] | None |
Optional custom thresholds. Defaults to DEFAULT_THRESHOLDS. |
Returns
ConnectivityLevel classificationConnectivityLevel
—
ConnectivityReport
dataclass
Complete connectivity report for a site.
Groups pages by connectivity level and provides distribut…
ConnectivityReport
dataclass Complete connectivity report for a site.
Groups pages by connectivity level and provides distribution statistics.
Attributes
| Name | Type | Description |
|---|---|---|
isolated |
list |
Pages with score < 0.25 |
lightly_linked |
list |
Pages with score 0.25-1.0 |
adequately_linked |
list |
Pages with score 1.0-2.0 |
well_connected |
list |
Pages with score >= 2.0 |
total_pages |
int |
Total number of pages analyzed |
avg_score |
float |
Average connectivity score across all pages |
Methods 3
get_distribution
Get count distribution by level.
get_distribution
def get_distribution(self) -> dict[str, int]
Get count distribution by level.
Returns
dict[str, int]
get_percentages
Get percentage distribution by level.
get_percentages
def get_percentages(self) -> dict[str, float]
Get percentage distribution by level.
Returns
dict[str, float]
to_dict
Convert to dictionary for serialization.
to_dict
def to_dict(self) -> dict
Convert to dictionary for serialization.
Returns
dict