MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / get_category_slug

Method get_category_slug

scripts/migrate_posts.py:114–123  ·  view source on GitHub ↗

Get category slug by ID (cached).

(self, cat_id: int)

Source from the content-addressed store, hash-verified

112 return all_posts
113
114 def get_category_slug(self, cat_id: int) -> str:
115 """Get category slug by ID (cached)."""
116 if cat_id in self._category_cache:
117 return self._category_cache[cat_id]
118 cat = self.api_get(f"categories/{cat_id}")
119 if cat and isinstance(cat, dict):
120 slug = cat.get("slug", "")
121 self._category_cache[cat_id] = slug
122 return slug
123 return ""
124
125 def detect_subcategory(self, post: dict) -> str:
126 """Detect insights subcategory from post categories."""

Callers 2

detect_subcategoryMethod · 0.95
migrateMethod · 0.95

Calls 2

api_getMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected