blob: fb40d76734a31697f74b69dc17781110a06f765a (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
"""Abstract base class for parsers."""
from abc import ABC, abstractmethod
from typing import AsyncGenerator, Generic, TypeVar
T = TypeVar("T")
class AsyncParser(ABC, Generic[T]):
@abstractmethod
async def ingest(self, data: T, **kwargs) -> AsyncGenerator[str, None]:
pass
|