MCPcopy Create free account
hub / github.com/clockworknowledge/menome_processor / extract_title

Function extract_title

app/routers/document.py:31–38  ·  view source on GitHub ↗
(soup: BeautifulSoup, document_id: str)

Source from the content-addressed store, hash-verified

29
30# Inside documents.py
31def extract_title(soup: BeautifulSoup, document_id: str) -> str:
32 title = soup.title.string if soup.title else None
33 if not title:
34 title = f"Untitled Document {document_id}"
35 meta_title = soup.find('meta', attrs={'property': 'og:title'})
36 if meta_title:
37 title = meta_title.get('content', title)
38 return title
39
40
41def extract_primary_image(soup: BeautifulSoup) -> str:

Callers 1

add_documentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected