You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
372 B

import abc
from typing import Dict
from pydantic import BaseModel
class BaseData(BaseModel, abc.ABC):
filename: str
meta: Dict = {}
@classmethod
def parse(cls, **kwargs):
return cls.parse_obj(kwargs)
def __hash__(self):
return hash(tuple(self.dict()))
class TextData(BaseData):
text: str
class FileData(BaseData):
pass