"""
Contentmatter statistics data structures.
"""

from dataclasses import dataclass
from typing import Dict, Any


@dataclass
class ContentmatterStats:
    """Statistics about contentmatter (MultiMarkdown key-value pairs) in a document."""

    has_contentmatter: bool
    total_pairs: int
    average_key_length: float
    average_value_length: float
    url_values: int
    email_values: int
    date_values: int

    def to_dict(self) -> Dict[str, Any]:
        """Convert stats to dictionary."""
        return {
            "has_contentmatter": self.has_contentmatter,
            "total_pairs": self.total_pairs,
            "average_key_length": self.average_key_length,
            "average_value_length": self.average_value_length,
            "url_values": self.url_values,
            "email_values": self.email_values,
            "date_values": self.date_values
        }