puppygirl-py/puppygirl/puppytype.py
2025-10-07 17:31:32 -04:00

13 lines
489 B
Python

from typing import IO, Iterable, TypeAlias, TYPE_CHECKING
if TYPE_CHECKING:
from string import Template
from bs4 import BeautifulSoup, Tag
from .elements import Node
Markup: TypeAlias = str | bytes | IO[str] | IO[bytes]
ParsedMarkup: TypeAlias = "BeautifulSoup | Tag | Node | Template"
Parsable: TypeAlias = Markup | ParsedMarkup
ParsableIterable: TypeAlias = "Iterable[Parsable]"
RenderableElement: TypeAlias = "Node | Iterable[Node]"
Templates: TypeAlias = "dict[str, Template]"