from __future__ import annotations

import io
from typing import Any

from .bill_parser import TimBillParser
from .bill_processor import PDFBillingProcessor

def parse_tim_bill_pdf(pdf_content: bytes, *, include_danfe: bool = False) -> dict[str, Any]:
    pdf_bytes = io.BytesIO(pdf_content)
    parser = TimBillParser()
    dfs = parser.parse_pdf(pdf_bytes)
    processor = PDFBillingProcessor(include_danfe=include_danfe)
    return processor.normalize(dfs)

__all__ = ["parse_tim_bill_pdf", "TimBillParser", "PDFBillingProcessor"]
