rss-news/utils/article_utils.py
2025-07-11 09:44:31 +02:00

23 lines
534 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# utils/article_utils.py
import hashlib
def clean_text(text: str) -> str:
return text.strip()
def generate_id(link: str) -> str:
return hashlib.md5(link.encode("utf-8")).hexdigest()
def categorize_article(text: str) -> str:
# Dummy-Kategorie
return "Allgemein"
def tag_article(text: str) -> list:
# Dummy-Tags
return ["tag1", "tag2"]
def summarize_text(text: str) -> str:
return text[:200] + "..."
def rewrite_text(text: str) -> str:
return text # Platzhalter, z.B. für GPT-Rewrite später